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
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...)
Mit freundlichen Grüssen
Beat Friedli
------------------------------------------------------------------------------
UFA AG
Hofmattstrasse 40
3360 Herzogenbuchsee
Tel: ++41 62 956 63 94
email: <mailto:[EMAIL PROTECTED]>
homepage: <http://www.ufa.ch>
homepage: <http://www.hypona.ch>
-----Ursprüngliche Nachricht-----
Von: Jon Skeet [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 30. August 2001 16:52
An: LOG4J Users Mailing List
Betreff: RE: [beginner] How to send logs to different Appenders?
> Hi Jon.....so I have tried to modify my lo4j.properties of
> the basic example
> that comes with distribution.
> That's what I'd like to obtain:
>
> Class MyApp----------->Console Appender
> Class com.foo.Bar------>File Appender
>
> Here's how I have structured my log4j.properties:
>
> log4j.rootCategory=DEBUG,A1,A2
This is the problem - you're saying that *all* categories should be
appended to A1 *and* A2.
Change that to
log4j.rootCategory=DEBUG
and everything should be okay (I think :)
> log4j.category.MyApp=A1
> log4j.category.com.foo=A2
Ah - not quite. You need an INHERITED in the above (before the A1 or A2)
to say that the priority is the inherited one - otherwise it'll assume
DEBUG (I believe).
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]