SpringBoot 项目 配置 log4j2 未生效

Springboot项目上配置log4j2,因为要 排除 SpringBoot 默认的日志依赖,一开始看网上,大多数总是在这种方式

        
            org.springframework.boot
            spring-boot-starter-web
            
            
                
                    org.springframework.boot
                    spring-boot-starter-tomcat
                
                 org.springframework.boot
                    spring-boot-starter-logging
                
            
        

发现 在我这里并没有鸟用,于是在

spring-boot-starter

下面去排除,发现配置文件生效了。

可生效的配置方式


            org.springframework.boot
            spring-boot-starter
            
                
                    spring-boot-starter-logging
                    org.springframework.boot
                
            
        
        
            org.springframework.boot
            spring-boot-starter-web
            
            
                
                    org.springframework.boot
                    spring-boot-starter-tomcat
                




            
        
        
            org.springframework.boot
            spring-boot-starter-log4j2
        

你可能感兴趣的:(项目中遇到的问题)