springboot啟動報錯LoggerFactory is not a Logback LoggerContext but Logback...


由於springboot默認日志組件為logback,當時項目使用的為log4j,在打war包到tomcat啟動時報如上錯誤。

原因:log4j日志組件和自帶logback日志組件沖突。

解決方法:

    將默認日志組件排除。

<!--解決log4j和logback沖突-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>


 

原文鏈接:https://blog.csdn.net/m0_37125796/article/details/80989002


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM