logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ossi petz <ossip...@gmail.com>
Subject turn off log messages in rootLogger which are supposed to end up in a named logger
Date Thu, 25 Jun 2009 16:31:45 GMT
hello

I'm sorry for asking this boring question but after hours of experiments
and even reading a (quite old) book I cant find a solution. So maybe
someone can give me a hint what i am doing wrong.

The plan is to have an application log file and a performanceLog file
which contains only certain messages ("PhasesLogger").

At the moment the messages for the performanceLog end up in the root
logger too. This is my log config:

log4j.rootLogger=DEBUG,R
log4j.logger.PhasesLogger=DEBUG,performanceLogger

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/home/tomcat/tomcat/logs/log.log
log4j.appender.R.MaxFileSize=10000KB
log4j.appender.R.MaxBackupIndex=10

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{ISO8601} [%-6p] %30c - %m%n
# log4j.appender.R.threshold=ERROR

# Performance Appender:
log4j.appender.performanceLogger=org.apache.log4j.RollingFileAppender
log4j.appender.performanceLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.performanceLogger.layout.ConversionPattern=%d{ISO8601}
[%-6p] %14c - %m%n
log4j.appender.performanceLogger.File=/home/tomcat/tomcat/logs/performanceLogger.log
log4j.appender.performanceLogger.MaxFileSize=10000KB
log4j.appender.performanceLogger.MaxBackupIndex=10
# log4j.appender.performanceLogger.threshold=DEBUG



The performanceLogger is retrieved like this:

private static final Logger PLOG = Logger.getLogger("PhasesLogger");
PLOG.debug("things...");

how can i turn off to have the log messages for the
phases/performanceLogger end up in the rootLogger file too?

any hints are welcome!

regards

ossi


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message