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 "McDowell, Mark" <Mc...@ncs.com> on 2002/05/07 16:46:55 UTC

Question about multiple loggers/appenders...

What I'd like to do is have multiple loggers with different 
appenders and different log destinations for each.  But I 
don't want to have every log message go to root as well.

I have tried using a filter on the root logger, but it
seems to affect all other loggers as well...  

I also tried setting the root logger with a WriterAppender, 
and use a NullWriter for the appender.  It works, meaning that
I get different log messages to each logger/appender, but I 
get an error message saying, "log4j:ERROR No output stream 
or file set for the appender named [STDOUT]."  There are no 
other error messages - I am using the DOMConfigurator and have 
it set to debug mode, and the logger and appender seem to 
configure correctly - I just get the error message.

Anyone have any ideas?

Mark

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question about multiple loggers/appenders...

Posted by Scott Farquhar <sc...@atlassian.com>.
Set additivity to false for your appenders.  That way they will not also 
be used by parent appenders.

Search the archives for additivity=false.

Cheers,
Scott

McDowell, Mark wrote:
> What I'd like to do is have multiple loggers with different 
> appenders and different log destinations for each.  But I 
> don't want to have every log message go to root as well.
> 
> I have tried using a filter on the root logger, but it
> seems to affect all other loggers as well...  
> 
> I also tried setting the root logger with a WriterAppender, 
> and use a NullWriter for the appender.  It works, meaning that
> I get different log messages to each logger/appender, but I 
> get an error message saying, "log4j:ERROR No output stream 
> or file set for the appender named [STDOUT]."  There are no 
> other error messages - I am using the DOMConfigurator and have 
> it set to debug mode, and the logger and appender seem to 
> configure correctly - I just get the error message.
> 
> Anyone have any ideas?
> 
> Mark
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


-- 
Scott Farquhar :: scott@atlassian.com

Atlassian :: http://www.atlassian.com
      Supporting YOUR J2EE World



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>