简单的log4j配置问题

时间:2011-10-25 14:37:38

标签: log4j

我不记得怎么做了,

我有这个日志配置

# ***** Set root logger level to DEBUG and its only appender to A.
log4j.rootLogger=DEBUG, R
log4j.rootLogger=INFO, A

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.MaxFileSize=100mb
log4j.appender.R.MaxBackupIndex=1000
log4j.appender.R.File=${catalina.base}/logs/server.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


# ***** A is set to be a ConsoleAppender.
log4j.appender.A=org.apache.log4j.ConsoleAppender
# ***** A uses PatternLayout.
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

log4j.logger.org.hibernate.type.BasicTypeRegistry=INFO
log4j.logger.com.opensymphony.xwork2.config.providers.XmlConfigurationProvider=INFO

我希望appender A是info和appender R进行调试。你能提醒我怎么做吗?

1 个答案:

答案 0 :(得分:1)

log4j.rootLogger=DEBUG, R, A

log4j.appender.A.Threshold=INFO