On May 2, 2008, at 7:26 AM, Petr Vorel wrote:

> Hello,
>
> I'm trying to configure logging to syslog (with SyslogAppender) and > NOT to console (stdout). Logging to syslog is fine, but I still get > messages to stdout as well (for some reason I don't want to redirect > it > /dev/null )
>
> Does anyone have any idea what could cause logging to stdout as well?
>
> I'm running command (with -Dlog4j.debug - in case it helps to > somebody to find something from it).
>
> Thanks a lot for advise.
>
> Pev
>
> My log4j configuration ---------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
>
>  <!-- syslog -->
>  <appender name="syslog" class="org.apache.log4j.net.SyslogAppender">
>    <param name="SyslogHost" value="localhost"/>
>    <param name="Facility" value="LOCAL0"/>
>    <param name="Threshold" value="INFO"/>
>    <!--
>     <param name="Threshold" value="FATAL"/>
>    -->
>    <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern" value="[%p] %l %d{dd MMM > hh:mm:ss.SSS aa} %t [%c:%L]%n%m%n%n"/>
>    </layout>
>  </appender>
>
>
>  <logger name="org.quartz">
>    <level value="debug" />
>    <appender-ref ref="syslog" />
>  </logger>
>
>
>  <root>
>    <level value="info" />
>    <appender-ref ref="syslog" />
>  </root>
>

By the way, you have attached one syslog appender to two places in the hierarchy. Unless you specify additivity = false for a logger, any logging request will also be processed by its parent in the hierarchy and so on until it is processed by the root logger. So any logging request to a "org.quartz" or any decendent logger with a level of debug or higher will be processed by syslog appender twice, once for its attachment to the "org.quartz" logger and once for its attachment to the root logger.


Thanks for correcting another mistake.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to