简单的log4j配置问题[英] simple log4j configuration issue

本文是小编为大家收集整理的关于简单的log4j配置问题的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我不记得该怎么做,

我有此日志配置

# ***** 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成为信息和appender r进行调试.你能提醒我如何做吗?

推荐答案

log4j.rootLogger=DEBUG, R, A

log4j.appender.A.Threshold=INFO

本文地址:https://www.itbaoku.cn/post/1575147.html

问题描述

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?

推荐答案

log4j.rootLogger=DEBUG, R, A

log4j.appender.A.Threshold=INFO