log4j2+slf4j日志不打印问题
2020-06-15 本文已影响0人
0__o
问题原因:
使用slf4j+log4j2时使用的桥接包是log4j-slf4j-impl,https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html
项目中存在多个日志的实现(例如:slf4j-log4j12)
通过mvn dependency:tree查看现有依赖包,进行排除即可
问题原因:
使用slf4j+log4j2时使用的桥接包是log4j-slf4j-impl,https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html
项目中存在多个日志的实现(例如:slf4j-log4j12)
通过mvn dependency:tree查看现有依赖包,进行排除即可