logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harp, George" <GH...@GAINSystems.com>
Subject RE: Log4j Appenders/Category Usage
Date Thu, 06 Oct 2005 17:23:34 GMT
Isn't there also a way to say only log warn messages? I just don't know
the xml format.
Something to do with a filter? 

-----Original Message-----
From: Bender Heri [mailto:HBender@Ergonomics.ch] 
Sent: Thursday, October 06, 2005 12:20 PM
To: Log4J Users List
Subject: RE: Log4j Appenders/Category Usage

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

---------------------------------------------------------------------
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