You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Stephen Levinson <St...@sun.com> on 2001/09/12 14:38:05 UTC

RE: How to set up appenders for individual categories using confi g files.

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:dunnigan@cqg.com]
Sent: Tuesday, September 11, 2001 4:56 PM
To: log4j-user@jakarta.apache.org
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: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org