You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Alan Brown <ab...@opstechnology.com> on 2003/12/08 20:33:05 UTC

Having 2 loggers log to the same file...

I'd like to have 2 separate parts of my code log to the same file
because they share functionality.  However I'm getting a class cast
exception when I specify the following in my log config file...


log4j.logger.opsx.server.db = DEBUG, A3
log4j.additivity.opsx.server.db = false
log4j.logger.opsx.server.dac.OpsTransaction = DEBUG, A3
log4j.additivity.opsx.server.dac.OpsTransaction = false

log4j.appender.A3=org.apache.log4j.RollingFileAppender
log4j.appender.A3.MaxFileSize=1024KB
log4j.appender.A3.MaxBackupIndex=40
log4j.appender.A3.File=\\opsx\\log\\db\\OpsxConnection.log
log4j.appender.A3.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=* %-5p (%x) %d{DATE} %c -
\r\n%m\r\n\r\n


If I comment out lines 3 and 4 then everything works ok with the logging
going to the default logging file.  

Am I doing something obviously wrong?

Thanks In Advance.

alan


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