simple log4j configuration issue

2019-09-17 03:53发布

问题:

i can't remember how to do this,

i have this log config

# ***** 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

i want appender A to be info and appender R to be debug. can you remind me how to do that?

回答1:

log4j.rootLogger=DEBUG, R, A

log4j.appender.A.Threshold=INFO


标签: log4j