SpringBoot LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

SpringBoot with error when starting the project:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/tongqinyuan/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/tongqinyuan/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.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]
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/Users/tongqinyuan/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.Log4jLoggerFactory

In fact, this is slf4j log out of the package leads, how to view packet collisions it?

zookeeper junit packages and packages are incorporated log package:

<dependency>
<the groupId> org.apache.zookeeper </ the groupId>
<the artifactId> ZooKeeper </ the artifactId>
<Exclusions>
<Exclusion>
<the artifactId> SLF4J-log4j12 </ the artifactId>
<the groupId> org.slf4j </ the groupId>
< / Exclusion>
</ Exclusions>
</ dependency>
install maven help the plugin, click dependency Analyzer analysis package to view the conflict in pom.xml file

 

 

By exclude exclude post-conflict find out just fine;

 

Guess you like

Origin www.cnblogs.com/exmyth/p/11080547.html