Logback日志配置-按级别分文件输出


    
    
    ${APP_NAME}
    
    
        
            %d{yyyy-MM-dd HH:mm:ss} %5p %c:%L %m%n
        
    
    
    
        
        ${LOG_HOME}/${APP_NAME}.log
        
            
            ${LOG_HOME}/logbacks/${APP_NAME}-%d{yyyy-MM-dd}-%i.log
            180
            
            
                30MB
            
        
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} [ %thread ] - [ %-5level ] [ %logger{50} : %line ] - %msg%n
        
    

    
    
    
    
        
        
    

    

    
    
        
        ${LOG_HOME}/${APP_NAME}-error.log
        
            -->
            ERROR
            ACCEPT
            DENY
        
        
            
            ${LOG_HOME}/logbacks/${APP_NAME}-error-%d{yyyy-MM-dd}-%i.log
            180
            
            
                30MB
            
        
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} [ %thread ] - [ %-5level ] [ %logger{50} : %line ] - %msg%n
        
    
    
        
        ${LOG_HOME}/${APP_NAME}-info.log
        
        
            
            INFO
            ACCEPT
            DENY
        
        
            
            ${LOG_HOME}/logbacks/${APP_NAME}-info-%d{yyyy-MM-dd}-%i.log
            180
            
            
                30MB
            
        
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} [ %thread ] - [ %-5level ] [ %logger{50} : %line ] - %msg%n
        
    

    
    
    
    
        
        
    

    

 

你可能感兴趣的:(java)