logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Rice" <joe.r...@mercurymd.com>
Subject Do Not Log one Logger to Console
Date Fri, 19 Aug 2005 14:11:22 GMT
I have a log4j.properties file with a Console appender and a RollingFile
appender.  I have a specific Logger that I only want logged to the
RollingFile appender and not to the Console appender.  I thought I could
do this by explicity associating an appender with the Logger but that
doesn't seem to be working.  Can I do this if I have my Console appender
associated with the root logger?  Here's my log4j.properties.
 
log4j.rootLogger=ERROR, Console
 
# Console is set to be a ConsoleAppender.
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%-5p %c{2}.%M.%L - %m%n
 
#File Appender
log4j.appender.LogFile=org.apache.log4j.FileAppender
log4j.appender.LogFile.file=conf/translator.log
log4j.appender.LogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern=%-5p %c{2} - %m%n
 
# Logger that should only log to the file and NOT to the Console
log4j.logger.com.mycompany.SpecificLogger = DEBUG, LogFile
 
Any help would be appreciated.
 
Thanks,

Joe

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message