springboot logback配置模版

(转载 Spring Boot-日志配置)

在src/main/resources下创建logback-spring.xml即可。




    
    

    ${appname}

    
    
        
        
            
                %d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n
            
        
    

    
        
        
            
            ERROR
            
            DENY
            
            ACCEPT
        
        
        ${logback.logdir}/info.${logback.appname}.log
        
        
            
            ${logback.logdir}/info.${logback.appname}.%d{yyyy-MM-dd}.log
            
            90
            
            
        
        
        
            UTF-8
            %d [%thread] %-5level %logger{36} %line - %msg%n
        
    


    
        
        
            Error
        
        
        ${logback.logdir}/error.${logback.appname}.log
        
        
            
            ${logback.logdir}/error.${logback.appname}.%d{yyyy-MM-dd}.log
            
            90
            
            
        
        
        
            UTF-8
            %d [%thread] %-5level %logger{36} %line - %msg%n
        
    

    
    
        
        
        
    


你可能感兴趣的:(springboot logback配置模版)