LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation
时间: 2023-10-18 07:00:03 浏览: 205
日志错误信息中的“LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation”表示日志工厂(LoggerFactory)不是Logback的LoggerContext,但是Logback在类路径上存在。这意味着存在与Logback冲突的其他日志实现。
解决这个问题有两种方法:
1. 移除Logback:您可以从项目的依赖中移除Logback,这样就不会与其他日志实现发生冲突了。
2. 排除冲突实现:如果您希望继续使用Logback,而且需要解决与其他实现的冲突,可以通过在项目的依赖配置中排除冲突实现来解决。例如,在Maven项目中,您可以使用<exclusions>标签来排除冲突的实现,如上文引用中所示。
如果您正在使用WebLogic服务器,还需要将'org.slf4j'添加到WEB-INF/weblogic.xml文件的prefer-application-packages中,以解决这个问题。
请根据您的实际需求选择适合的解决方案。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback](https://blog.csdn.net/qq_37241221/article/details/126134281)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Error(13) 解决LoggerFactory is not a Logback LoggerContext but Logback is on the classpath](https://blog.csdn.net/qq_38225558/article/details/111823106)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文