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 "Nair, Ranjini" <RN...@mail.intracorp.com> on 2002/02/22 21:47:39 UTC
Working with two or more categories
Hi,
Is it possible to have two or more categories in a properties file and get
the log output to go to different log files based on category? How should
the categories be defined to do this?
Thanks,
Ranjini.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Working with two or more categories
Posted by Steve Ebersole <st...@austin.rr.com>.
Here is an example (I'll use the new "Logger" syntax):
#############################################################
# Define the root logger
#############################################################
log4j.rootLogger=DEBUG, STDOUT
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=.............
#############################################################
# Define logger-specific appenders
#############################################################
log4j.cat1=INFO, FILE1
log4j.additivity.cat1=false
log4j.cat2=WARN, FILE2
log4j.additivity.cat2=false
log4j.appender.FILE1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE1.file=/the/file/for/category1
log4j.appender.FILE2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE2.file=/the/file/for/category2
----- Original Message -----
From: "Nair, Ranjini" <RN...@mail.intracorp.com>
To: <lo...@jakarta.apache.org>
Sent: Friday, February 22, 2002 2:47 PM
Subject: Working with two or more categories
> Hi,
> Is it possible to have two or more categories in a properties file and
get
> the log output to go to different log files based on category? How should
> the categories be defined to do this?
>
> Thanks,
> Ranjini.
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>