【日志】log4j

#log4j.rootLogger = INFO

log4j.rootLogger = INFO,stdout1
log4j.appender.stdout1 = org.apache.log4j.ConsoleAppender
log4j.appender.stdout1.Target = System.out
log4j.appender.stdout1.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout1.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method: %l%n %m%n


#log4j.logger.cn.com.agree.hx.logger.test.test2 = ERROR,tt2
#log4j.additivity.cn.com.agree.hx.logger.test.test2=false
#log4j.appender.tt2= org.apache.log4j.RollingFileAppender
#log4j.appender.tt2.File =   ./logs/log.log
#log4j.appender.tt2.Append = true
#log4j.appender.tt2.layout = org.apache.log4j.PatternLayout
#log4j.appender.tt2.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method: %l%n %m%n


log4j.logger.cn.com.agree.hx.logger.test.test2=info,CL
log4j.additivity.cn.com.agree.hx.logger.test.test2 = false # false,不继承rootLogger的特性
log4j.appender.CL= org.apache.log4j.RollingFileAppender
log4j.appender.CL.File=./logs/log.log
log4j.appender.CL.layout=org.apache.log4j.PatternLayout
log4j.appender.CL.layout.ConversionPattern=[ %t:%-20r ]  %d{DATE} %5p %t %X{url} %c{1}:%M - %m%n 
log4j.appender.CL.bufferedIO=false
log4j.appender.CL.MaxFileSize=50KB
log4j.appender.CL.MaxBackupIndex=10
log4j.appender.CL.encoding=UTF-8
 

%5p 右对齐

%-5p 左对齐,5个字符

你可能感兴趣的:(日志,log,log4)