I suspect your example will not work for the reason you specify.

Another approach - set the logger level to DEBUG, attach both appenders to
the same logger, and set a threshold on appender2 so it doesn't see the
DEBUG output.

Something like this ...

log4j.logger.classA=DEBUG, appender1, appender2
log4j.appender.appender2.Threshhold=INFO

I think this approach will work for you.  Btw this is discussed on page 58
in the Complete Log4j Manual.


-----Original Message-----
From: Hakan Koseoglu [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 11, 2004 6:14 AM
To: [EMAIL PROTECTED]
Subject: multiple files, same logger and different tresholds


Hi all,

I'm trying to log to two or more different files at the same time. i
have set my rootLogger and I set a couple of appenders on different
tresholds.

What I want to have is, I want to have class classA to log with a
treshold of DEBUG to file a.log, I want the same class log to the fole
B, with a treshold of WARN.

I set up a custom level like
log4j.logger.classA=DEBUG, appender1
log4j.logger.classA=INFO, appender2

I'm not sure if this will work or not. WIll the output appear on both
files, limited with the treshold or will it only appear on on of the
definitions, since I am actually setting one property with two vales.

Is it possible to have such debugging to two files?

TIA,

Hakan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to [EMAIL PROTECTED] 

Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to