logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Erskine <michael.ersk...@ketech.com>
Subject RE: JDBCAppender configuration
Date Tue, 15 Jul 2008 15:53:23 GMT

> The JDBCAppender is shoddy anyhow - write yourself a replacement. It's a
> great way to learn about what makes a good Appender.

To follow up: what I tend to do is have a custom JDBC Appender that adds a small custom log
entry object (with all interesting info from the LoggingEvent) to a limited sized BlockingDeque
and immediately returns. I have a background daemon thread that waits on the queue and adds
the info to the logging database. I have a simple Connection test and failure recovery mechanism
and I've hooked in a simple "purge" statement that can be run every few hours to limit the
size of the log table, and some magic configuration entries so I can do some cool things inside

I'd post the classes if I wasn't developing proprietary software under NDA (and it wasn't
so specific to my projects), but it's pretty simple stuff -- I learned most of how Log4J works
by stepping through the source in Eclipse.

Michael Erskine.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message