logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maarten Bosteels" <mbosteels....@gmail.com>
Subject setting threshold for SyslogAppender
Date Mon, 17 Sep 2007 08:51:48 GMT
Hello all,

I am using log4j-1.2.15.
And I would like to configure the SyslogAppender via a properties file.

Programmatically it works:

  public static void main(String[] args) {
    Logger.getRootLogger().removeAllAppenders();
    Logger.getRootLogger().setLevel(Level.DEBUG);
    SyslogAppender appender = new SyslogAppender(new SimpleLayout(),
"localhost", SyslogAppender.LOG_LOCAL6);
    appender.setThreshold(Level.INFO);
    Logger.getRootLogger().addAppender(appender);
    Logger.getRootLogger().debug("some debug");
    Logger.getRootLogger().info("some info");
    Logger.getRootLogger().warn("some warn");
    Logger.getRootLogger().error("some error");
  }

But when I use this config file:

log4j.rootLogger=DEBUG,Syslog
log4j.appender.Syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.Syslog.syslogHost=localhost
log4j.appender.Syslog.facility=LOCAL6
log4j.appender.Syslog.layout=org.apache.log4j.SimpleLayout
log4j.appender.Syslog.treshold=INFO


I get the following message:  log4j:WARN No such property [treshold] in
org.apache.log4j.net.SyslogAppender.
And of course the treshold is not working.

Should I report this in bugzilla ?

Maarten

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message