logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Drake <Tom.Dr...@tavant.com>
Subject RE: Exclude a class from a particular appender.....
Date Tue, 06 Jan 2004 19:10:29 GMT
I assume that your Root logger is set to use the CONSOLE appender. That
being the case, you can set the 'additive' parameter of your
com.shawmut.portal.scheduler logger to false. This way, any messages logged
to this logger will NOT be sent to it's parent logger (e.g. Root/CONSOLE) as

-----Original Message-----
From: Pitre, Russell [mailto:RPITRE@shawmut.com] 
Sent: Tuesday, January 06, 2004 8:50 AM
To: log4j-user@logging.apache.org
Subject: Exclude a class from a particular appender.....

Hello All-


I'm using Jboss 3.2 and I'm trying to figure out how to exclude a
certain class from the console appender.  I have two appender's; a
console appender for ALL my classes and another appender for a specific
package of classes.  This package provides scheduling capabilities from
my app and writes to the console every 10 seconds.  I would like to have
this package log to a RollingFileAppender ONLY and not to the console
appender every 10 seconds.  Does anyone know how to EXCLUDE a class from
being logged on a certain appender such as the CONSOLE appender seen
below?  Any help is greatly appreciated.



  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">

    <param name="Target" value="System.out"/>

            <!-- CHANGE "Value" to debug, info, warn, etc...-->

    <param name="Threshold" value="info"/>


    <layout class="org.apache.log4j.PatternLayout">

      <!-- The default pattern: Date Priority [Category] Message\n -->

      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}]







              <appender name="UserDefined"

                        <param name="File"

                        <param name="Append" value="false"/>

                        <param name="MaxFileSize" value="500KB"/>

                        <param name="MaxBackupIndex" value="1"/>


                        <layout class="org.apache.log4j.PatternLayout">

                          <param name="ConversionPattern" value="%d %-5p
[%c] %m%n"/>



                        <category name="com.shawmut.portal.scheduler">

                                    <priority value="info"/>

                                    <appender-ref ref="UserDefined"/>







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

View raw message