slf4j-api整合maven 工程日志配置文件

pom.xml:

        
			org.slf4j
			slf4j-api
			1.7.5
		
		
			ch.qos.logback
			logback-core
			1.2.3
		
		
			ch.qos.logback
			logback-classic
			1.2.3
		

配置文件logback.xml:

"1.0" encoding="UTF-8"?>
"false">
    
    "LOG_HOME" value="../logs" />
    
    "STDOUT"
        class="ch.qos.logback.core.ConsoleAppender">
        class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            
            %d{yy-MM-dd HH:mm:ss.sss} [%thread] %-5level %logger \(%file:%line\) - [%X{track_tag}] %msg%n  
            
        
    
    
    
    
    "FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            
            ${LOG_HOME}/log-%d{yyyy-MM-dd}.%i.log
            
            30
        
        class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            
        
            
            %d{yy-MM-dd HH:mm:ss.sss} [%thread] %-5level %logger - [%X{track_tag}] %msg%n  
            UTF-8  
        
        
        class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            64MB
        
    

    
    "info">
        ref ref="STDOUT" />
    

你可能感兴趣的:(slf4j-api整合maven 工程日志配置文件)