logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ossi petz <ossip...@gmail.com>
Subject Re: AW: turn off log messages in rootLogger which are supposed to end up in a named logger
Date Thu, 03 Sep 2009 17:32:01 GMT
hello

sorry for the late: thanks.

this did the trick! :)

ossi


Bender Heri schrieb:
> Something like 
> log4j.logger.PhasesLogger.additivity=false
> I am not quite sure about the correct syntax in properties file (I work always with xml
files).
> The additivity flag of a logger prevents the loggin event to climb up further the logger
hierarchy.
> Heri
> 
> -----Urspr√ľngliche Nachricht-----
> Von: news [mailto:news@ger.gmane.org] Im Auftrag von ossi petz
> Gesendet: Donnerstag, 25. Juni 2009 18:32
> An: log4j-user@logging.apache.org
> Betreff: turn off log messages in rootLogger which are supposed to end up in a named
logger
> 
> 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


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