日志沖突問題

在開發(fā)過程中發(fā)現(xiàn)了日志沖突問題,雖然不影響運行還是想著解決一下
image.png
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.分析產(chǎn)生沖突的jar 以及版本

查看日志可以分析出來 是 slf4j-log4j12-1.7.30.jar 和 log4j-slf4j-impl-2.10.0.jar 產(chǎn)生了沖突

2.查找沖突版本

①那我們來尋找沖突的jar都是誰引用進來的,我們先找到pom.xml


image.png

② 讓我們點擊這個結(jié)構(gòu)樹


image.png

3.屏蔽不需要的版本

①讓我們輸入 log4j-slf4j,選擇屏蔽2.10.0這個版本


image.png
image.png

4.再次運行

image.png

Maven 插件 maven helper

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內(nèi)容