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

相关推荐
RemainderTime4 天前
(十二)Spring Cloud Alibaba 2023.x:基于 Filebeat 构建轻量级 ELK日志追踪体系
分布式·elk·elasticsearch·微服务·架构·logback
ideal-cs11 天前
总结:生产环境Logback日志配置模板与pattern格式案例
java·log4j·logback·pattern·后端日志
非情剑13 天前
logback日志脱敏、FASTJSON日志脱敏
logback
雨辰AI16 天前
SpringBoot3 + 人大金仓 V9 全栈日志实战:Logback + Loki + Filebeat 构建统一日志平台
java·数据库·后端·云原生·eureka·logback·政务
NEGl DRYN1 个月前
Spring Boot 3.3.4 升级导致 Logback 之前回滚策略配置不兼容问题解决
java·spring boot·logback
eSsO KERF1 个月前
使用 Logback 的最佳实践:`logback.xml` 与 `logback-spring.xml` 的区别与用法
xml·spring·logback
色空大师1 个月前
【日志文件配置详解】
java·logback·log4j2·日志
成为大佬先秃头2 个月前
日志框架:Logback
springboot·logback
回到原点的码农2 个月前
Spring Boot 3.3.4 升级导致 Logback 之前回滚策略配置不兼容问题解决
java·spring boot·logback
shark22222222 个月前
springboot中配置logback-spring.xml
spring boot·spring·logback