logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Ebersole" <steveebers...@austin.rr.com>
Subject Re: Question about setup
Date Thu, 03 Jan 2002 00:58:33 GMT
Say you have packages com.foo.bar.util and com.foo.bar.system.

############################################################################
######
# Define root logger
############################################################################
######
log4j.rootLogger=DEBUG, STDOUT

############################################################################
######
# Define non-root loggers
############################################################################
######
log4j.com.foo.bar.util=DEBUG, UTL_FILE
log4j.additivity.com.foo.bar.util=false

log4j.com.foo.bar.system=DEBUG, SYS_FILE
log4j.additivity.com.foo.bar.system=false

############################################################################
######
# Appenders
############################################################################
######
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout

log4j.appender.UTL_FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.UTL_FILE.DatePatern='.'yyyy-MM-dd
log4j.appender.UTL_FILE.File=/your/log/dir/util.txt
log4j.appender.UTL_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.UTL_FILE.layout.ConversionPattern=%d %-5p %m%n

log4j.appender.SYS_FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.SYS_FILE.DatePatern='.'yyyy-MM-dd
log4j.appender.SYS_FILE.File=/your/log/dir/system.txt
log4j.appender.SYS_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.SYS_FILE.layout.ConversionPattern=%d %-5p %m%n


HTH


----- Original Message -----
From: "Christopher Randall" <crandall@tivre.com>
To: "Log4j-User (E-mail)" <log4j-user@jakarta.apache.org>
Sent: Wednesday, January 02, 2002 6:53 PM
Subject: Question about setup


I would appreciate if somebody could indulge me with this architectural
question I have about Log4J:

I need to setup a logging scheme with the following characteristics:

1. Each package in our Java framework should have a corresponding
logging category (i.e. com.foo.bar)
2. Each logger category will have a different FileAppender to log to a
separate file, with a filename that corresponds to its package name
(i.e. com_foo_bar.txt)

Any suggestions on what the easiest way to set this up might be? I would
like to do as little programmatic setup as possible, putting as much of
the setup into a config file.

Thanks for your time in response,
Chris

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



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


Mime
View raw message