2 zcxgz362324 zcxgz362324 于 2016.01.20 21:01 提问

log4j配置,有人可以帮我解释一下吗????求求求啦啦啦

log4j.rootLogger=ERROR,stdout
log4j.category.org=ERROR, stdout
log4j.category.net=ERROR, stdout
log4j.category.httpclient=ERROR, stdout
log4j.category.fwserver=ERROR,stdout
log4j.category.com.cosco.coris=ERROR,stdout
log4j.category.com.cosco.coris.job=ERROR,stdout
#log4j.rootLogger=DEBUG,stdout
#log4j.category.org=DEBUG, stdout
#log4j.category.net=DEBUG, stdout
#log4j.category.httpclient=DEBUG, stdout
#log4j.category.fwserver=DEBUG,stdout
#log4j.category.com.cosco.coris=DEBUG,stdout
#log4j.category.com.cosco.coris.job=DEBUG,stdout

support code

log4j.category.fwserver.dao.test=ERROR,stdout

appender writes to console

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%p [an%d{HH:mm:ss SSS}] %c{1}.%M(%L): %m%n

appender for performance log

log4j.appender.LogSystem=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LogSystem.File=performance.log
log4j.appender.LogSystem.DatePattern='.'yyyyMMdd
log4j.appender.LogSystem.layout=org.apache.log4j.PatternLayout
log4j.appender.LogSystem.layout.ConversionPattern=%m%n

appender for performance log ext

log4j.appender.LogSystem2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LogSystem2.File=performance_desc.log
log4j.appender.LogSystem2.DatePattern='.'yyyyMMdd
log4j.appender.LogSystem2.layout=org.apache.log4j.PatternLayout
log4j.appender.LogSystem2.layout.ConversionPattern=%m%n

logger for LogSystem

log4j.logger.fwserver.utility.LogSystem=ERROR,LogSystem
log4j.additivity.fwserver.utility.LogSystem=false

logger for LogUtil

log4j.logger.fwserver.utility.LogUtil=ERROR,stdout
log4j.additivity.fwserver.utility.LogUtil=false

logger for LogSystem2

log4j.logger.fwserver.utility.LogSystem2=INFO,LogSystem2
log4j.additivity.fwserver.utility.LogSystem2=false

logger for job

log4j.appender.monitor=org.apache.log4j.DailyRollingFileAppender
##??${CORIS_JOB_HOME}/????Coris????java.io.FileNotFoundException: /jobMonitor.log (Permission denied (errno:13)) added by weidl2 2009-2-18
log4j.appender.monitor.File=jobMonitor.log
log4j.appender.monitor.DatePattern='.'yyyyMMdd
log4j.appender.monitor.layout=org.apache.log4j.PatternLayout
log4j.appender.monitor.layout.ConversionPattern=%p | %d | %m %n

log4j.logger.com.cosco.coris.job.batchTaskList.BatchTaskJob=ERROR, monitor

appender for TimeTraceUtil log

log4j.appender.TimeTrace=org.apache.log4j.DailyRollingFileAppender
log4j.appender.TimeTrace.File=timeTrace.log
log4j.appender.TimeTrace.DatePattern='.'yyyyMMdd
log4j.appender.TimeTrace.layout=org.apache.log4j.PatternLayout
log4j.appender.TimeTrace.layout.ConversionPattern=%m%n

logger for TimeTrace

log4j.logger.fwserver.utility.trace.TimeTraceUtil=DEBUG,TimeTrace
log4j.additivity.fwserver.utility.trace.TimeTraceUtil=true

appender for edi tracing ws

log4j.appender.WsLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.WsLog.File=ediTracing.log
log4j.appender.WsLog.DatePattern='.'yyyyMMdd
log4j.appender.WsLog.layout=org.apache.log4j.PatternLayout
log4j.appender.WsLog.layout.ConversionPattern=%m%n

logger for edi tracing ws

log4j.logger.fwserver.utility.WsLogUtil=ERROR,WsLog
log4j.additivity.fwserver.utility.WsLogUtil=true

5个回答

rui888
rui888   Ds   Rxr 2016.01.21 09:11
已采纳
caozhy
caozhy   Ds   Rxr 2016.01.20 21:02
caozhy
caozhy   Ds   Rxr 2016.01.20 21:02
zcxgz362324
zcxgz362324 这个网站我以前看过,内容有点少
接近 2 年之前 回复
wojiushiwo945you
wojiushiwo945you   Ds   Rxr 2016.01.20 21:20

这个就是log4j的配置属性,是log4j的基础知识,有必要先了解下的。
这篇文章介绍的相当详细,可供参考:http://www.cnblogs.com/alipayhutu/archive/2012/06/21/2558249.html

wojiushiwo945you
wojiushiwo945you #号部分是注释。
接近 2 年之前 回复
91program
91program   Ds   Rxr 2016.01.20 21:12

百度查找“log4j配置” 有很多的文章介绍这个。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!