Hi
[sorry I sent my post by mistake using html]

>Get each class to use a different category

That's exactly my problem. It's not clear to me how to use a different
category to each class.

>From the examples I only see piaces of codes like this :

Category cat  = Category.getInstance(MyApp.class.getName());
Category cat2 = Category.getInstance(Bar.class.getName());

but then how do I state that the category cat for example referes
to FirstCategory and cat2 to SecondCategory  ??

log4j.category.FirstCategory=INHERITED,A2
log4j.category.SecondCategory=WARN, A3

Thanks for your attention.
regards
Francesco


----- Original Message -----
From: "Jon Skeet" <[EMAIL PROTECTED]>
To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, August 30, 2001 2:55 PM
Subject: RE: [beginner] How to send logs to different Appenders?


> I'm new to Log4j. Can anyone tell me how to direct log
> messages belonging to a class to one appender and
> messages belonging to other classes to another appender?

Get each class to use a different category, and then specify the
appenders by category, eg:

// Everything goes to appender A1
log4j.rootCategory=DEBUG, A1

// Everything from FirstCategory also goes to appender A2
// The priority is inherited from the root category
log4j.category.FirstCategory=INHERITED,A2

// Everything from SecondCategory also goes to appender A3
// The priority is set to Warning
log4j.category.SecondCategory=WARN, A3

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