spring boot更换日志为log4j2

<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> 

<!-- 添加 log4j 依赖 -->  
<dependency>  
    <groupId>org.springframework.boot</groupId>  
    <artifactId>spring-boot-starter-log4j</artifactId>  
</dependency>

关于移除:如果不做移除会报类冲突。

 

之后在resources中添加log4j2.xml即可

posted @ 2017-11-13 14:49  剑握在手  阅读(529)  评论(0编辑  收藏  举报
返回顶部↑