How to configure log4j2.xml for log4jdbc?

2019-08-02 03:54发布

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.

2条回答
手持菜刀,她持情操
2楼-- · 2019-08-02 04:14

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.

查看更多
Root(大扎)
3楼-- · 2019-08-02 04:17

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.

查看更多
登录 后发表回答