log4j category
Posted
by Nuno Furtado
on Stack Overflow
See other posts from Stack Overflow
or by Nuno Furtado
Published on 2009-05-25T11:02:26Z
Indexed on
2010/04/27
1:03 UTC
Read the original article
Hit count: 579
I have the following on my log4j.properties
log4j.rootLogger = debug, stdout, fileLog
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.fileLog = org.apache.log4j.RollingFileAppender
log4j.appender.fileLog.File = C:/logs/services.log
log4j.appender.fileLog.MaxFileSize = 256MB
log4j.appender.fileLog.MaxBackupIndex = 32
#Category: ConsultaDados
log4j.category.ConsultaDados=ConsultaDados
log4j.appender.ConsultaDados=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ConsultaDados.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsultaDados.layout.ConversionPattern={%t} %d - [%p] %c: %m %n
log4j.appender.ConsultaDados.file=C:/logs/consulta.log
log4j.appender.ConsultaDados.DatePattern='.' yyyy-MM-dd-HH-mm
And im creating my logger with :
myLogger = Logger.getLogger("ConsultaDados");
But this doesnt log my calls to the file. they get thrown into the rootLogger
Any ideas?
© Stack Overflow or respective owner