Title: AW: [beginner] How to send logs to different Appenders?

Jon,
Thank you very much. You really saved me from running under a train...
(I spent hours and hours but I never 'saw' anything like Threshold.)

Beat Friedli



-----Urspr�ngliche Nachricht-----
Von: Jon Skeet [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 31. August 2001 14:34
An: LOG4J Users Mailing List
Betreff: RE: [beginner] How to send logs to different Appenders?


> I'm followed this conversation step by step and am still not able to
write those 3 lines of code :-) write

> log4j.rootCategory=INFO
> log4j.category.ufa=DEBUG, A2
> log4j.category.ufa=INHERITED, A1

Of those last two lines, only one will be picked up. Two lines can't
have the same key (or if they do, they won't both be available.)

> The name of the root-Package ist ufa
> A1 writes to the standard-output -> works fine
> A2 writes in a file -> works fine
> I want all messages with priority DEBUG or higher  in the file
> I want all messages with priority INFO or higher  on the
standard-output
> Is anybody out there how tells me, what I am doing wrong ?
> (I have read the manual, but my englisch is not yet perfect...)

What you want is to do the priority filtering at the *appender* level
rather than the category level, ie:

log4j.rootCategory=INFO

log4j.category.ufa=DEBUG, A1, A2

log4j.appender.A1.Threshold=DEBUG
[insert rest of A1 stuff]

log4j.appender.A2.Threshold=INFO
[insert rest of A2 stuff]

Jon

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

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

Reply via email to