使用log4j记录到数据库 [英] Log to a database using log4j
本文介绍了使用log4j记录到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于在log4j中 javadoc
警告:此版本的JDBCAppender很可能在将来完全替换。此外,它不会记录异常。
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?
推荐答案
如果你正在寻找一个数据库附加器不仅工作,而且支持连接池,被维护和正确记录,比考虑logback的 DBAppender 。
If you are looking for an database appender which not only works, but also supports connection pooling, is maintained and properly documented, than consider logback's DBAppender.
足够讽刺的是,javadoc中关于在将来的log4j版本中删除JDBCAppender的警告是由我写的。
Ironically enough, the warning in the javadocs about removing JDBCAppender in future versions of log4j was written by me.
这篇关于使用log4j记录到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文