springboot中设置不同日志级别分别归档

使用logback分级别进行日志分档保存




    
    
    
    


    
    
    
    
        
        
        
            
                %d{yyyy-MM-dd HH:mm:ss.SSS} ----> [%thread] ---> %-5level %logger{50} - %msg%n
                UTF-8
            
        
        
            
                %d{yyyy-MM-dd HH:mm:ss.SSS} ==== [%thread] ==== %-5level %logger{50} - %msg%n
                UTF-8
            
        
    
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} ==== [%thread] ==== %-5level %logger{50} - %msg%n
            UTF-8 
        
        
        
        
        
            
            ${LOG_HOME}/${appName}-error-%d{yyyy-MM-dd}-%i.log
            
            365
            
            
                100MB
            
        
        
        
            error
            ACCEPT
            DENY
        
    



    
    
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} ==== [%thread] ==== %-5level %logger{50} - %msg%n
            UTF-8 
        
        
            ${LOG_HOME}/${appName}-debug-%d{yyyy-MM-dd}-%i.log
            
                100MB
            
            365
        
        
            debug
            ACCEPT
            DENY
        
    
    
    
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} ==== [%thread] ==== %-5level %logger{50} - %msg%n
            UTF-8 
        
        
            ${LOG_HOME}/${appName}-info-%d{yyyy-MM-dd}-%i.log
            365
            
                100MB
            
        
        
            info
            ACCEPT
            DENY
        

    
    
        
            %d{yyyy-MM-dd HH:mm:ss.SSS} ==== [%thread] ==== %-5level %logger{50} - %msg%n
            UTF-8 
        
        
            ${LOG_HOME}/${appName}-warn-%d{yyyy-MM-dd}-%i.log
            365
            
                100MB
            
        
        
            warn
            ACCEPT
            DENY
        
    
    
    
        
    
    
    
    
    
    
    
        
        
        
        
        
    

 

你可能感兴趣的:(springboot)