springboot整合log4j2

1.排除springboot本身日志 
2.添加log4j2 maven没有父项目 就必须指定version!!
3.配置application.yml文件 打印sql级别为debug
4.配置log4j2.xml

logging.config=classpath:log4j2.xml
logging.level.com.zhkj.shopping=debug
#mybatis-plus.mapper-locations = classpath*:/mapper/**Mapper.xml
#输出有结果集 mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#mybatis.configuration.log-impl=org.apache.ibatis.logging.log4j2.Log4j2Impl

 
            org.springframework.boot
            spring-boot-starter
            ${springboot.version}
            
                
                    org.springframework.boot
                    spring-boot-starter-logging
                
            
        
        
            org.springframework.boot
            spring-boot-starter-web
            ${springboot.version}
            
            
                
                    org.springframework.boot
                    spring-boot-starter-logging
                
            
        


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







    
    
        
        
            
            
            
        
        
        
            
            
            
            
                
                
            
        
        
            
            
            
                
                
            
            
            
        
        
            
            
            
                
                
            
        
    
    
    
        
        
        
        
        
            
            
            
            
        
    


你可能感兴趣的:(spring,boot,log4j,后端)