关于 logback 使用遇到问题与解决问题记录

logback.xml文件中的配置




	
	
		true
	
	
	
	
	
	${APP_NAME}
	
	
	
	
		
			
				
					%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{0}:%L- %msg%n
				
			
			
				
			
		
	
	
	
	
	
		${LOG_PATH}/${APP_NAME}-info-30dt.log
		
			${LOG_PATH}/${APP_NAME}-info-30dt.log.%d{yyyy-MM-dd}.%i
			
			
				1024MB
			
		
		
			%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{0}:%L- %msg%n
		
	
	
	
	
	
		${LOG_PATH}/${APP_NAME}-error-30dt.log
		
			${LOG_PATH}/${APP_NAME}-error-30dt.%d{yyyy-MM-dd}.%i
			
			
				1024MB
			
		
		
			ERROR
		
		
			%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{0}:%L- %msg%n
		
	

	
	
		
		
		
	

 

遇到问题(1)

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/shuang/maven_repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/shuang/maven_repository/org/slf4j/slf4j-log4j12/1.7.12/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
log4j:WARN No appenders could be found for logger (com.alibaba.druid.pool.DruidDataSource).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

 上面的问题是因为存在相同的jar包,检查一下是否存在slf4j与log4j等相关重复jar包

 

遇到问题(2)

14:49:53,026 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction - Could not find Janino library on the class path. Skipping conditional processing.
14:49:53,026 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction - See also http://logback.qos.ch/codes.html#ifJanino
14:49:53,125 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [STDOUT]. Did you define it below instead of above in the configuration file?
14:49:53,125 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details.

 上面的问题是缺少下面的jar包

   
    
    
        org.codehaus.janino
        janino
        2.6.1
    

 

你可能感兴趣的:(log4j,slf4j,logback)