比较实用的springboot日志系统配置

在配置文件中加入配置:logging.config=classpath:logback-spring.xml

目录结构:

比较实用的springboot日志系统配置_第1张图片



    purchase
    
    
        System.out
        
        
            %d{yyyy-MM-dd HH:mm:ss} %-5level [%-4relative] [%thread]  %logger{36}:%L - %msg%n
        
    
    
    
        
        /home/dcb/log/purchase/logs/app-log.log
        
            
            /home/dcb/log/purchase/logs/app-debug-%d{yyyy-MM-dd}.txt
            
            40
            
            1GB
            
                
            
        
        
            %d{yyyy-MM-dd HH:mm:ss} %-5level [%-4relative] [%thread]  %logger{36}:%L - %msg%n
        
        
        
            DEBUG
        
    
    
        /home/dcb/log/purchase/logs/app-info.log
        
            /home/dcb/log/purchase/logs/app-info-%d{yyyy-MM-dd}.txt
            
            40
            
            1GB
            
                    
                
            
        
        
            %d{yyyy-MM-dd HH:mm:ss} %-5level [%-4relative] [%thread]  %logger{36}:%L - %msg%n
        
        
            INFO
        
    
    
        /home/dcb/log/purchase/logs/app-error.log
        
            /home/dcb/log/purchase/logs/app-error-%d{yyyy-MM-dd}.txt
            
            40
            
            1GB

            
                    
                
                
            
        

        
            %d{yyyy-MM-dd HH:mm:ss} %-5level [%-4relative] [%thread]  %logger{36}:%L - %msg%n
        

        
            ERROR
        
    

    
        
        
        
        
    

你可能感兴趣的:(springboot)