logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Terp" <...@net-mill.com>
Subject Newbie question on priority
Date Wed, 07 Mar 2001 11:05:50 GMT

Hi, I'm new to Log4J and I really like so far...

However, I'm having problems setting up a simple 
logging in the following manner:

I need to be able to log to the console and to a file:

log4j.appender.CONSOLE=org.apache.log4j.FileAppender
log4j.appender.CONSOLE.File=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%-5p %c{1} %3x - %m%n

log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=../log/output.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d %-5p %3x - %m%n
log4j.appender.FILE.MaxFileSize=10MB
log4j.appender.FILE.Append=false
log4j.appender.FILE.MaxBackupIndex=1

With a rootCategory like:

log4j.rootCategory=INFO, FILE, CONSOLE

that works ok!

My problem is that I would like to be able to have logging to
the console at priority INFO and logging to the FILE at prioity
DEBUG.

Also, i would like to be able to set a lower priority for 
a certain class, while root is higher i.e., 

log4j.rootCategory=INFO, TestCat
com.foo.bar.Test = DEBUG

But that wont do the trick.... what have I missed??

Thanks...

^torsten



Mime
View raw message