码迷,mamicode.com
首页 > 其他好文 > 详细

log4j日志properties配置

时间:2019-12-09 11:42:05      阅读:525      评论:0      收藏:0      [点我收藏+]

标签:inf   log4j   rop   logger   error   ext   false   ons   col   

#Console Log
log4j.rootLogger=INFO,console,debug,info,warn,error

LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] boot%X{context} - %5p [%t] --- %c{1}: %m%n

#A1--Print log to Console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=DEBUG
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=${LOG_PATTERN}

log4j.appender.info=org.apache.log4j.DailyRollingFileAppender
log4j.appender.info.Threshold=INFO
log4j.appender.info.File=${LOG_PATH}/${LOG_FILE}_info.log
log4j.appender.info.DatePattern=.yyyy-MM-dd
log4j.appender.info.layout = org.apache.log4j.PatternLayout
log4j.appender.info.layout.ConversionPattern=${LOG_PATTERN}

log4j.appender.error=org.apache.log4j.DailyRollingFileAppender
log4j.appender.error.Threshold=ERROR
log4j.appender.error.File=${LOG_PATH}/${LOG_FILE}_error.log
log4j.appender.error.DatePattern=.yyyy-MM-dd
log4j.appender.error.layout = org.apache.log4j.PatternLayout
log4j.appender.error.layout.ConversionPattern=${LOG_PATTERN}


log4j.appender.debug=org.apache.log4j.DailyRollingFileAppender
log4j.appender.debug.Threshold=DEBUG
log4j.appender.debug.File=${LOG_PATH}/${LOG_FILE}_debug.log
log4j.appender.debug.DatePattern=.yyyy-MM-dd
log4j.appender.debug.layout = org.apache.log4j.PatternLayout
log4j.appender.debug.layout.ConversionPattern=${LOG_PATTERN}

log4j.appender.warn=org.apache.log4j.DailyRollingFileAppender
log4j.appender.warn.Threshold=WARN
log4j.appender.warn.File=${LOG_PATH}/${LOG_FILE}_warn.log
log4j.appender.warn.DatePattern=.yyyy-MM-dd
log4j.appender.warn.layout = org.apache.log4j.PatternLayout
log4j.appender.warn.layout.ConversionPattern=${LOG_PATTERN}

#MQ\u53D1\u9001\u8BB0\u5F55
log4j.logger.mqLog=INFO,mqLog
log4j.additivity.mqLog = false
log4j.appender.mqLog=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.mqLog.Threshold=ERROR
log4j.appender.mqLog.File=${LOG_PATH}/${LOG_FILE}_mqLog.log
log4j.appender.mqLog.DatePattern=.yyyy-MM-dd
log4j.appender.mqLog.layout = org.apache.log4j.PatternLayout
log4j.appender.mqLog.layout.ConversionPattern=${LOG_PATTERN}

 

log4j日志properties配置

标签:inf   log4j   rop   logger   error   ext   false   ons   col   

原文地址:https://www.cnblogs.com/chenxi-mxj/p/12009881.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!