Log to a database using log4j

Daniel Moura picture Daniel Moura · Sep 1, 2009 · Viewed 26.8k times · Source

Since in log4j javadoc is

WARNING: This version of JDBCAppender is very likely to be completely replaced in the future. Moreoever, it does not log exceptions.

What should I do to log to a database?

Answer

Ceki picture Ceki · Sep 2, 2009

If you are looking for a database appender which not only works, but also supports connection pooling, is maintained and properly documented, than consider logback's DBAppender.

Ironically enough, the warning in the javadocs about removing JDBCAppender in future versions of log4j was written by me.