The error was a result of mislocating the libraries built from log4cplus.
So, the example above is the way to implement a custom filter in log4cplus. Unless anyone objects I will leave this here as there are very few examples of log4cplus filters on the web.