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,重新加载;然后运行项目即可。

相关推荐
零度@1 天前
logback 速查上手
logback
没有bug.的程序员2 天前
Spring Boot 日志管理:从 Logback 深度配置到 ELK 万亿级日志中枢实战
java·spring boot·elk·logback·日志·管理
南朝雨10 天前
Spring Boot Admin日志监控坑点:远程配置的logging.file.name为何生效又失效?
java·spring boot·spring cloud·微服务·logback
麦兜*19 天前
Spring Boot 日志配置 + Logback vs Log4j2 性能对比 + 选型建议
spring boot·log4j·logback
M***Z21020 天前
springboot中配置logback-spring.xml
spring boot·spring·logback
sunnyday042622 天前
深入理解Java日志框架:Logback与Log4j2配置对比分析
java·log4j·logback
JavaEdge.24 天前
Logback 启动错误修复说明
logback
煎饼皮皮侠1 个月前
快速查找应用日志的几个场景
unzip·logback·grep
垚森1 个月前
【问题解决】关于log4j与logback依赖冲突的解决方案
log4j·logback·问题解决·依赖冲突
wL魔法师1 个月前
【日志】Logback 配置问题(no applicable action for [springProfile])
logback