Mixing log4j 1.x and log4j 2

混江龙づ霸主 提交于 2019-11-30 04:41:50

Are you aware that log4j2 includes a bridge for log4j-1.2? You can use it by removing the old log4j-1.2.17.jar, and include these three jars:

  • log4j-api-2.x.jar
  • log4j-core-2.x.jar
  • log4j-1.2-api-2.x.jar

This will result in all calls that your application makes to the log4-1.2 API to be routed to the log4j2 implementation. The FAQ has a diagram that may clarify things. (Don't forget to remove the old log4j-1.2 jar from the classpath!)

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