logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ton van Bart" <ton.van.b...@abnamro.nl>
Subject Unable to set treshold on appender?
Date Mon, 03 Sep 2001 16:50:02 GMT
Hi,
For an app that we're building, I'm trying to set up log4j in such a way
that all messages of priority info or above are logged to a file, and
messages of prioriry fatal also go to syslog (where they can be picked
up by a management station).
In order to do this, I tried to setup one Category with two appenders.
The root Category has it's priority set to INFO, and I want the
syslogappender to have priority FATAL.

Config file (for test) is as follows:

log4j.rootCategory=INFO, console, logfile

log4j.appender.logfile=org.apache.log4j.ConsoleAppender
log4j.appender.logfile.treshold=error
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=logfile: %d %t [%p] %m%n

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=console: %d %t [%p] %m%n

But when I run my test app, I get an error message:
log4j:WARN No such property [treshold] in
org.apache.log4j.ConsoleAppender.

However when I read the Javadoc, I see that ConsoleAppender inherits a
method setTreshold(priority) from org.apache.log4j.AppenderSkeleton,
leading me to believe that I should be able to set the treshold for an
appender in the manner specified above. I also tried to do a setTreshold
in the code, with similar results.
What am I doing wrong? Is there any other way to accomplish what I want
?

TIA for any info, Ton van Bart

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


Mime
View raw message