logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rookbluff <rookbl...@gmail.com>
Subject Re: Custom Filter Help
Date Sun, 13 Nov 2005 19:37:17 GMT
Thanks! That was it!

On 11/13/05, Andreas Fester <afester@apache.org> 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
>
> [...]
>
>

Mime
View raw message