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 Ton van Bart <to...@abnamro.nl> on 2001/09/03 18:50:02 UTC

Unable to set treshold on appender?

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