logback的使用和logback.xml详解

logback的配置介绍




    
    

    
    
        
            
                [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%X{X-B3-TraceId:-},%X{X-B3-SpanId:-}] [%thread] [%level] [%logger{36}:%line] - %msg%n
            
        
    
    
    
        ${log.path:-/data/log}/${app.name:-service}.log
        
        
            ${log.path:-/data/log}/${app.name:-service}-%d{yyyy-MM-dd}.log
            90
        
        
            
                [%d{yyyy-MM-dd HH:mm:ss.SSS}] [%X{X-B3-TraceId:-},%X{X-B3-SpanId:-}] [%thread] [%level] [%logger{36}:%line] - %msg%n
            
        
    

    
    
        
        
    


  

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

private final static Logger logger = LoggerFactory.getLogger(Application_Supplier.class);

 

logger.info("logback 成功了");
logger.error("logback 成功了");
logger.debug("logback 成功了");

 

 

你可能感兴趣的:(logback的使用和logback.xml详解)