Sorry, have some mail sending issues currently...

-------- Original Message --------
Subject: Re: Custom Filter Help
Date: Sun, 13 Nov 2005 20:07:32 +0100
From: Andreas Fester <[EMAIL PROTECTED]>
To: Log4CXX User <[email protected]>,  [EMAIL PROTECTED]
References: <[EMAIL PROTECTED]>

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

[...]

-- 
Andreas Fester
mailto:[EMAIL PROTECTED]
WWW: http://www.littletux.net
ICQ: 326674288

Reply via email to