How to configure log4j2.xml for log4jdbc?

六月ゝ 毕业季﹏ 提交于 2019-12-11 06:33:50

问题


Does anyone know how to configure the log4j2.xml file to use log4jdbc? I have been searching for several hours and I can't seem to find anything.


回答1:


log4jdbc relies on SLF4J. There is to date no proper connector between SLF4J and Log4j 2.

If you want, you can instead use log4jdbc-log4j2, which addresses exactly this need of getting log4j2 to work with log4jdbc.




回答2:


As of beta5, Log4j 2.0 does not offer a JDBC Appender. However, the team is working on one and it is likely that a subsequent release will contain one.

Which also means: if you have any feature requests, ideas or comments, now would be a good time to let the team know!

The dev mailing list, user mailing list or Jira issue tracker are all fine places to get your voice heard.


Update: As of beta 7, Log4j2 offers JDBC, JPA, and NoSQL database appenders.



来源:https://stackoverflow.com/questions/15408840/how-to-configure-log4j2-xml-for-log4jdbc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!