idea排除logback
时间: 2023-10-13 09:03:35 浏览: 93
要在Idea中排除logback,你可以在项目的pom.xml文件中进行配置。根据引用和引用的信息,你需要在pom.xml文件中添加以下内容:
```
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
```
这样就可以将logback排除掉,同时使用引用中提到的slf4j-log4j12作为日志的实现。注意,具体的版本号和其他依赖可能需要根据你的实际情况进行调整。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [IDEA 报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath,如何排除依赖...](https://blog.csdn.net/zhanggonglalala/article/details/88953345)[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%"]
- *3* [idea项目启动报错,日志包冲突slf4j和logback冲突](https://blog.csdn.net/xi_yi_an_ming/article/details/117677641)[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 ]
阅读全文