spring boot更換日誌為log4j2

劍握在手發表於2017-11-13
<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即可

相關文章