LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logba...

简介: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.

LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/jack/.m2/repository/com/alibaba/external/org.slf4j.slf4j-log4j12/1.5.2/org.slf4j.slf4j-log4j12-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/jack/.m2/repository/org/slf4j/slf4j-nop/1.7.25/slf4j-nop-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/jack/.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/jack/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x.

日志:

Caused by: 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.helpers.NOPLoggerFactory loaded from file:/Users/jack/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-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.helpers.NOPLoggerFactory
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:389)
at org.springframework.util.Assert.isInstanceOf(Assert.java:327)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:274)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:231)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:210)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:292)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.alibaba.microtek.ApplicationKt.main(Application.kt:28)
... 6 more

大概就是说Logback已经在classpath中存在,这时候就应该意识到有Logback依赖冲突,在多个地方都有Logback的依赖。

相关文章
|
4天前
|
JavaScript 前端开发 Java
若依部署-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error]
若依部署-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[file_error]
|
Java API 网络性能优化
NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
报错日志: java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy at ch.
11104 0
|
2月前
|
Java 程序员
SpringBoot集成log4j2出现Logback configuration error detected: current ElementPath is
SpringBoot集成log4j2出现Logback configuration error detected: current ElementPath is
48 0
|
2月前
|
Java API Maven
解决SLF4J和logback报错SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
解决SLF4J和logback报错SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
|
2月前
|
监控 Java 测试技术
日志框架到底是Logback 还是 Log4j2
日志框架到底是Logback 还是 Log4j2
31 0
|
9月前
|
Java 数据库连接 API
快速了解常用日志技术(JCL、Slf4j、JUL、Log4j、Logback、Log4j2)
快速了解常用日志技术(JCL、Slf4j、JUL、Log4j、Logback、Log4j2)
60 0
|
10月前
|
XML 安全 Java
logback的使用和配置|logback比log4j的优点|logback是一个更好的log4j
logback的使用和配置|logback比log4j的优点|logback是一个更好的log4j
(六)Logback中的Filter
规律型过滤器继承自Filter抽象类,该类主要由带有ILoggingEvent参数的decide()方法组成。多个过滤器会基于三进制规则进行排序,每个过滤器的decide(ILoggingEvent event)方法依次会被调用,该方法返回FilterReply的枚举值,例如:DENY、NEUTRAL、ACCEPT。如果方法返回值为DENY,那么日志对象会被终止而不会被其它过滤器访问。
|
Java Spring
set Spring log level to debug so that we can learn more from log
set Spring log level to debug so that we can learn more from log
84 0
set Spring log level to debug so that we can learn more from log
|
Java
Log4j 与 logback对比、及使用配置
    二、参考文档 1.Log4j 与 logback对比、及使用配置
810 0