logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gulcu <...@urbanet.ch>
Subject Re: AsyncAppender
Date Wed, 17 Jan 2001 15:04:04 GMT

Leos,

There is one crucial information missing in your description. Which 
category are you logging to? Ceki

At 15:34 17.01.2001 +0100, you wrote:
>Hello Ceki,
>
>I have found one unexpected behaviour of
>asynchronous appender. When I use this config file,
>LOG_DAEMON will contain content of LOG_NOTIF too,
>though I set additivity to false. If I remove
>async, it works, as it should.
>
>
><?xml version="1.0" encoding="ISO-8859-1" ?>
><!DOCTYPE configuration SYSTEM "log4j.dtd">
>
><configuration>
>
>          <appender name="ASYNC_DAEMON"
>class="org.apache.log4j.AsyncAppender">
>             <appender-ref ref="LOG_DAEMON" />
>             <appender-ref ref="LOG_NOTIF" />
>          </appender>
>
>         <appender name="LOG_DAEMON"
>class="org.apache.log4j.RollingFileAppender">
>            <param name="File" value="logs/daemon.log" />
>            <param name="MaxFileSize" value="5MB" />
>            <param name="MaxBackupIndex" value="1000" />
>            <layout class="org.apache.log4j.PatternLayout">
>              <param name="ConversionPattern"
>                     value="%d | %15.15c{1} | %m%n"/>
>            </layout>
>         </appender>
>
>         <appender name="LOG_NOTIF"
>class="org.apache.log4j.RollingFileAppender">
>            <param name="File" value="logs/notifications.log" />
>            <param name="MaxFileSize" value="5MB" />
>            <param name="MaxBackupIndex" value="1000" />
>            <layout class="org.apache.log4j.PatternLayout">
>              <param name="ConversionPattern"
>                     value="%m\n"/>
>            </layout>
>         </appender>
>
>         <category name="myclass.status" additivity="false">
>           <priority value="info" />
>            <appender-ref ref="LOG_NOTIF" />
>         </category>
>
>         <root>
>            <priority value ="info" />
>            <appender-ref ref="ASYNC_DAEMON" />
>         </root>
>
></configuration>
>
>
>But when I create two AsyncAppenders and separate both logs to them,
>it works fine again.
>
>          <appender name="ASYNC_DAEMON"
>class="org.apache.log4j.AsyncAppender">
>             <appender-ref ref="LOG_DAEMON" />
>          </appender>
>          <appender name="ASYNC_NOTIF"
>class="org.apache.log4j.AsyncAppender">
>             <appender-ref ref="LOG_NOTIF" />
>          </appender>
>
>Is this behaviour correct? Now it uses one additional thread, doesn't
>it?
>Thank you.
>
>         LL
>
>--
>-----------------------------------------------------
>Leos Literak
>Software Engineer
>
>12snap s.r.o.
>Pstrossova 24
>110 00 Praha 1
>Czech Republic
>
>mobile:         +420-605-849-087
>phone:  +420-2-21-970-239
>fax:    +420-2-21-970-241
>e-mail: leos.literak@12snap.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

---
Freedom as in the capacity to exercise choice.


Mime
View raw message