logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Stauffer <stauffer.ja...@gmail.com>
Subject Re: Do Not Log one Logger to Console
Date Fri, 19 Aug 2005 14:31:56 GMT
Set additivity to false for that logger and the messages won't make it
to the root logger.

On 8/19/05, Joe Rice <joe.rice@mercurymd.com> wrote:
> 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
> 
> 


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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