spring boot更换日志为log4j2

<dependency>  
    <groupId>org.springframework.bootgroupId>  
    <artifactId>spring-boot-starterartifactId>  
    <exclusions>  
        <exclusion>  
            <groupId>org.springframework.bootgroupId>  
            <artifactId>spring-boot-starter-loggingartifactId>  
        exclusion>  
    exclusions>  
dependency> 

  
<dependency>  
    <groupId>org.springframework.bootgroupId>  
    <artifactId>spring-boot-starter-log4jartifactId>  
dependency>

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

 

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

你可能感兴趣的:(spring boot更换日志为log4j2)