LoggerFactory is not a Logback

错误信息

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

Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory loaded from file:/D:/maven/repository/org/slf4j/slf4j-simple/1.7.26/slf4j-simple-1.7.26.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.SimpleLoggerFactory

错误截图

问题分析:

1,分析日志:

1.1,标记1,2可以理解为发现2个绑定;

1.2,标记3,可以理解为:表示实际绑定的类型是org.slf4j.impl.SimpleLoggerFactory

1.3,可以看出,大概率是依赖冲突了

2,处理方案

**2.1,**安装Maven Helper,重启idea

切换到模式,按下图选择,输入logback,

选择exclude

2.2,重新加载;然后运行项目即可。

相关推荐
m0_7482475519 小时前
springboot中配置logback-spring.xml
spring boot·spring·logback
m0_7482500319 小时前
springboot使用logback自定义日志
java·spring boot·logback
程序猿熊跃晖19 小时前
多环境日志管理:使用Logback与Logstash集成实现高效日志处理
spring boot·elk·logback
CodeMonkey陈4 天前
springboot2.0整合logback日志(保姆级详细教程)
spring boot·后端·logback
m0_748233884 天前
使用 Logback 的最佳实践:`logback.xml` 与 `logback-spring.xml` 的区别与用法
xml·spring·logback
山海不说话4 天前
从零搭建微服务项目Base(第5章——SpringBoot项目LogBack日志配置+Feign使用)
spring boot·后端·spring·spring cloud·微服务·logback
wangbing112512 天前
开发指南098-logback-spring.xml说明
xml·spring·logback
归宿乐瑶13 天前
六.logback记录日志文件并按大小日期分割文件
java·spring boot·logback
小池先生13 天前
mybatisplus把sql日志打印到logback日志文件中
sql·mybatis·logback
Mr_sun.1 个月前
Logback日志文件详细配置
java·spring boot·logback