logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: Log4j Appenders/Category Usage
Date Thu, 06 Oct 2005 17:19:59 GMT
Because you forgot the attribute additivity="false"
BTW: you should use the new Identifier "logger". "category" is deprecated.

<logger name="com.company.a.b.c.f" additivity="false">

and 

<logger name="com.company.a.b.d.f" additivity="false">


Heri


> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Rakesh Patel
> Sent: Thursday, October 06, 2005 7:08 PM
> To: log4j-user@logging.apache.org
> Subject: Log4j Appenders/Category Usage
> 
> 
> I have the following log4j.xml file. I've included the 
> salient portions. here 
> is what i see:
> 
> 1. i see the logs from logger com.company.a.b.c.f in 
> msglog.log via the 
> message_appender (info level and above).
> 
> 2. i see the logs from logger com.company.a.b.d.f in 
> msglog.log via the 
> message_appender (info level and above).
> 
> question is : why do i see the logs of message_appender (what 
> is in msglog.log) 
> in syslog.log which should only be seeing WARN level 
> messages????? i'd like to 
> understand why i am seeing this type of behavior and what is 
> the correct way to 
> log what i want which is: system_appender should only log 
> warn message and 
> above from all logger com.company and down.
> 
> thanks
> 
> rakesh
> 
> ----
> 
> <appender name="message_appender" 
> class="org.apache.log4j.FileAppender">
>  <param name="File"  value="msglog.log"/>
>    <layout class="org.apache.log4j.PatternLayout">
>  <param name="ConversionPattern" value="[%d{yyyyMMdd 
> HH:mm:ss}] %m%n"/>
>    </layout>
> </appender>
> 
> <appender name="system_appender" 
> class="org.apache.log4j.FileAppender">
>  <param name="File"  value="syslog.log"/>
>    <layout class="org.apache.log4j.PatternLayout">
>  <param name="ConversionPattern" value="[%d{yyyyMMdd 
> HH:mm:ss}] %m%n"/>
>    </layout>
> </appender>
> 
> <category name="com.company.a.b.c.f">
>    <priority value="info"/>
>      <appender-ref ref="message_appender"/>
> </category>
> 
> <category name="com.company.a.b.d.f">
>    <priority value="info"/>
>       <appender-ref ref="message_appender"/>
> </category>
> 
> <category name="com.company">
>    <priority value="warn"/>
>       <appender-ref ref="system_appender"/>
> </category>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 

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


Mime
View raw message