On 11/13/05, Andreas Fester <[EMAIL PROTECTED]> wrote:
Thomas Owens wrote:
> Hey dudes,
>
> I am trying to implement a custom filter using log4cxx. I have
> subclassed Filter and implemented a decide() method. However, when I
> try to execute my program, log4cxx complains that my filter class cannot
> be found. Am I missing a step? Do I need to use one of the macros
> defined in object.h like DECLARE_LOG4CXX_OBJECT()?
Yes. See for example consoleappender.cpp and
include/log4cxx/consoleappender.h:
The .cpp file needs the
IMPLEMENT_LOG4CXX_OBJECT(...)
macro, the .h file needs
DECLARE_LOG4CXX_OBJECT(...)
and a cast table if necessary.
The macros are needed (among others) to allow dynamic loading of
the classes by name, this is what failed in your application ;-)
> The output of my program is:
>
> log4cxx: Could not instantiate class [FooFilter].
> log4cxx: Class not found: FooFilter
Best Regards,
Andreas
[...]
