Log4cxx custom appender

Assaf Lavie picture Assaf Lavie · May 17, 2009 · Viewed 7.8k times · Source

Is it possible to write a custom appender for log4cxx and have it configurable via a properties file (like the built-in appenders)? I'd prefer doing this without having to rebuild log4cxx (e.g. by deriving/extending an existing appender), if possible.

Can you point me toward an example?

Answer

brlcad picture brlcad · May 17, 2009

You can inherit from AppenderSkeleton or WriterAppender and get the same underlying behaviors without having to rebuilt log4cxx.

http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/test/cpp/vectorappender.h?view=markup http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/test/cpp/vectorappender.cpp?view=markup