开发中遇到的问题---【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>

 

posted on 2020-03-27 15:20  少年攻城狮  阅读(13165)  评论(0编辑  收藏  举报

导航