開發中遇到的問題---【ERROR in ch.qos.logback.core.joran.spi.Interpreter@49:40 - no applicable act】


問題:本地可以正常啟動,但是在測試環境,把application.yml放到bin目錄下,用腳本啟動就會啟動不了,報錯:“ERROR in ch.qos.logback.core.joran.spi.Interpreter@49:40 - no applicable act”;

分析:我項目要求用log4j2,日志引入和自帶的logback沖突導致,導致啟動的時候,無法確定按誰的規則去讀配置文件了。

方案:在pom.xml文件中引入下面的依賴;

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
    <exclusions>
        <exclusion>
            <artifactId>logback-core</artifactId>
            <groupId>ch.qos.logback</groupId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </exclusion>
    </exclusions>
</dependency>

 


免責聲明!

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



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