Use propertyConfigurator.configure(filename)
Check the examples and documentation for usage of the file
If you add an appender to the root category all categories inherit it
But you can add an appender to a particular category

log4j.category.com.mycom.Myapp=INFO, B1   // sets the category Myapp to
level INFO, appender B1

log4j.appender.B1=org.apache.log4j.RollingFileAppender   // appender B1 is a
rolling file appender

log4j.appenderB1.File=d:\\javaProjects\\MyProject\\log23.txt   // log23.txt
is the filename to use for appender B1




ONLY category Myapp gets appender B1 unless you assign it to other
categories as well


Hope this helps, 
--Stephen




-----Original Message-----
From: Mike Dunnigan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 4:56 PM
To: [EMAIL PROTECTED]
Subject: How to set up appenders for individual categories using config
files.


When I try to add an appender to a particular category using the
PropertyConfigurator I end up adding the appender to all my categories.Is
there a way to set up a particular category with an appender using config
files?

Thanks,

Mike


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