Spring MVC +Mybatis + Maven 配置之log4j配置

log4j配置


log4j.rootLogger = INFO , info, warn, error, stdout
<strong>log4j.</strong><span style="font-family:monospace;color:#8800;LINE-HEIGHT: 25px; BACKGROUND-COLOR: rgb(204,206,208); WHITE-SPACE: pre;">additivity</span><strong>.</strong>appenderName<strong>=true</strong> 
###控制台输出
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern =  %d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.stdout.Encoding=UTF-8
log4j.appender.CONSOLE.Threshold=INFO
###每日info输出
log4j.logger.info = info  
log4j.appender.info = org.apache.log4j.DailyRollingFileAppender
log4j.appender.info.File = ${webroot}/logs/convert/convert_info.log
log4j.appender.info.Append = true
log4j.appender.info.Threshold = INFO 
log4j.appender.info.layout = org.apache.log4j.PatternLayout
log4j.appender.info.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n
log4j.appender.info.datePattern='.'yyyy-MM-dd 
log4j.appender.info.filter.infoFilter = org.apache.log4j.varia.LevelRangeFilter
log4j.appender.info.filter.infoFilter.LevelMin=INFO
log4j.appender.info.filter.infoFilter.LevelMax=INFO
log4j.appender.info.Encoding=UTF-8

###每日警告输出
log4j.logger.warn = warn 
log4j.appender.warn=org.apache.log4j.DailyRollingFileAppender 
log4j.appender.warn.File = ${webroot}/logs/convert/convert_warn.log
log4j.appender.warn.Append=true 
log4j.appender.warn.Threshold=WARN 
log4j.appender.warn.layout=org.apache.log4j.PatternLayout 
log4j.appender.warn.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n
log4j.appender.warn.datePattern='.'yyyy-MM-dd
log4j.appender.warn.filter.warnFilter=org.apache.log4j.varia.LevelRangeFilter
log4j.appender.warn.filter.warnFilter.LevelMin=WARN
log4j.appender.warn.filter.warnFilter.LevelMax=WARN
log4j.appender.warn.Encoding=UTF-8

###每日错误输出
log4j.logger.error = error 
log4j.appender.error = org.apache.log4j.DailyRollingFileAppender
log4j.appender.error.File = ${webroot}/logs/convert/convert_error.log
log4j.appender.error.Append = true
log4j.appender.error.Threshold = ERROR 
log4j.appender.error.layout = org.apache.log4j.PatternLayout
log4j.appender.error.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n
log4j.appender.error.datePattern='.'yyyy-MM-dd
log4j.appender.error.filter.errorFilter=org.apache.log4j.varia.LevelRangeFilter
log4j.appender.error.filter.errorFilter.LevelMin=ERROR
log4j.appender.error.filter.errorFilter.LevelMax=ERROR
log4j.appender.error.Encoding=UTF-8

 
 

你可能感兴趣的:(spring,mvc,log4j,日志,控制台)