logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Pawson <da...@dpawson.co.uk>
Subject Re: Different appenders for different loggers?
Date Wed, 04 May 2005 18:11:07 GMT
On Wed, 2005-05-04 at 10:35 -0700, Steve Kuo wrote:
> Here's what I'm trying to do. Use one appender for a
> particular logger (say x.y.z), and another default
> appender for everything else.
> 
> The default appender is easy:
> log4j.rootLogger=ERROR, logFile
> log4j.appender.logFile=org.apache.log4j.RollingFileAppender
> log4j.appender.logFile.MaxFileSize=1MB
> and so on..
> 
> What I can't figure out is how to setup an appender
> for a particular logger instance?


log4j.<loggerName>=<level> \
|INHERITED| NULL,<appenderName>,<appenderName>...

are my notes. so for logger x.y.z it might be

log4j.x.y.z=DEBUG, a1

where a1 is defined as

log4j.appender.A1=<full appender class Name>
e.g.

log4j.appender.A1=org.apache.log4j.FileAppender

I think that's right.

HTH DaveP.

(Still fighting the book :-)
But making slow progress.

regards DaveP


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