0

We are using log4j 1.x as logging platform for quite some time now. Most of our applications are based on Spring Framework which also uses log4j 1.x. Now we wish to write logs in database and we know (heard) that this (official) JDBC appender is bad. What would you suggest that we do for production environment? Writing our own JDBC appender for log4j 1.x?

Also that JDBC appender apparently does not log exception which is important for us.

I know that Logback offers database appender, but I don't wish to switch - too much work. I also know that log4j 2 was rewritten and it's JDBC appender is OK, but it's not compatible with log4j 1.x even though it was compatibility API jar which has restrictions.

fritz
  • 111
  • 1
  • 11

1 Answers1

0

Maybe an option is to replace log4j with slf4j (http://www.slf4j.org/) and add log4jdbc appender (https://code.google.com/p/log4jdbc/)? Slf4j is a simple facade for log4j and other logging systems such as JCL or commons-logging where you don't need to change any line of code, you just need to add slf4j JARs into classpath and configure it.

Magic Wand
  • 1,572
  • 10
  • 9