log4j配置 按小时打印 异常信息分离

log4j配置 按小时打印 异常信息分离_第1张图片

 

内容:

log4j.rootLogger=DEBUG,CONSOLE,A,B
log4j.addivity.org.apache=false

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss}[%t] %-5p %c - %m%n
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.Encoding=UTF-8
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout

#log4j.appender.CONSOLE.File = e:/log4j/logs.txt


log4j.appender.A=org.apache.log4j.DailyRollingFileAppender 
log4j.appender.A.File=${catalina.home}/logs/FH_log/PurePro_
log4j.appender.A.DatePattern=yyyy-MM-dd-HH'.log'
log4j.appender.A.layout=org.apache.log4j.PatternLayout  
log4j.appender.A.layout.ConversionPattern=[FH_sys]  %d{yyyy-MM-dd HH\:mm\:ss} %5p %c{1}\:%L \: %m%n

# zhi ji lu yi chang xin xi
log4j.appender.B=org.apache.log4j.DailyRollingFileAppender  
log4j.appender.B.Threshold=ERROR
log4j.appender.B.File=${catalina.home}/logs/FH_log/Exce_
log4j.appender.B.DatePattern=yyyy-MM-dd'.log'
log4j.appender.B.layout=org.apache.log4j.PatternLayout  
log4j.appender.B.layout.ConversionPattern=[FH_sys]  %d{yyyy-MM-dd HH\:mm\:ss} %5p %c{1}\:%L \: %m%n

 

 

你可能感兴趣的:(后端)