日志冲突问题
2020-07-24 本文已影响0人
百年叔叔
在开发过程中发现了日志冲突问题,虽然不影响运行还是想着解决一下

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
1.分析产生冲突的jar 以及版本
查看日志可以分析出来 是 slf4j-log4j12-1.7.30.jar 和 log4j-slf4j-impl-2.10.0.jar 产生了冲突
2.查找冲突版本
①那我们来寻找冲突的jar都是谁引用进来的,我们先找到pom.xml

② 让我们点击这个结构树

3.屏蔽不需要的版本
①让我们输入 log4j-slf4j,选择屏蔽2.10.0这个版本


4.再次运行

Maven 插件 maven helper