<category name="com.shawmut.portal.scheduler" additivity="false">
                <priority value="INFO"/>
                <appender-ref ref="SCHEDULER"/>
        </category>

additivity=false means don't log through through the ROOT logger 
(which goes to the console)

You cannot configure a category twice, I've got no idea which
configuration it will use if you do.

Wouldn't this question be more suitably located on log4j-user?

Regards,
Adrian

On Tue, 2004-01-06 at 20:42, Pitre, Russell wrote:
> That doesn't solve my problem......
> 
> I took a look at log4j.xml and I didn't find an example of I'm trying to
> do........here's my log4j.xml file.......if you take a look at the
> "Userdefined Categories" you'll notice where I'm using the
> additivity="false" value to eliminate logs being sent to the console.
> Well, that's what I'm trying to do at least.....I've googled all day
> long but to no avail........so frustrating....and I can't find anything
> within the Jboss docs either.....(I have the CS subscription, and I'll
> reserve my comments about their documentation)......So if anyone can
> help me out I would really appreciate it..
> 
> ========================================================================
> ==
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
> debug="false">
> 
>   <!-- ================================= -->
>   <!-- Preserve messages in a local file -->
>   <!-- ================================= -->
> 
>   <!-- A time/date based rolling appender -->
>   <appender name="FILE"
> class="org.jboss.logging.appender.DailyRollingFileAppender">
>     <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
>     <param name="Append" value="false"/>
>       <param name="Threshold" value="info"/>
> 
>     <!-- Rollover at midnight each day -->
>     <param name="DatePattern" value="'.'yyyy-MM-dd"/>
> 
>     <!-- Rollover at the top of each hour
>     <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
>     -->
> 
>     <layout class="org.apache.log4j.PatternLayout">
>       <!-- The default pattern: Date Priority [Category] Message\n -->
>       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
> 
>       <!-- The full pattern: Date MS Priority [Category] (Thread:NDC)
> Message\n
>       <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x)
> %m%n"/>
>        -->
>     </layout>     
>   </appender>
> 
> 
>   <!-- ============================== -->
>   <!-- Append messages to the console -->
>   <!-- ============================== -->
> 
>   <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}]
> %m%n"/>
>     </layout>
>   </appender>
>   
>   <appender name="JSR77" class="org.apache.log4j.FileAppender">
>     <param name="Append" value="false"/>
>     <param name="File" value="${jboss.server.home.dir}/log/jsr77.log"/>
>     <layout class="org.apache.log4j.PatternLayout">
>       <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}]
> %m%n"/>
>     </layout>
>   </appender> 
> 
>   <!-- ============================= -->
>   <!--      User Defined Appenders   -->
>   <!-- ============================= -->
> 
>   <appender name="SCHEDULER"
> class="org.jboss.logging.appender.RollingFileAppender">
>     <param name="File" value="${jboss.server.home.dir}/log/guyute.log"/>
>       <param name="Threshold" value="debug"/>
>     <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"/>
>     </layout>     
>   </appender>
> 
> 
>   <!-- ============================== -->
>   <!--      User Defined Categories   -->
>   <!-- ============================== -->
> 
>       <category name="com.shawmut.portal.scheduler">
>               <priority value="INFO"/>
>               <appender-ref ref="SCHEDULER"/>
>       </category>
> 
>       <category name="com.shawmut.portal.scheduler"
> additivity="false">
>               <priority value="INFO"/>
>               <appender-ref ref="CONSOLE"/>
>       </category>
> 
>   <!-- ======================= -->
>   <!-- Setup the Root category -->
>   <!-- ======================= -->
> 
>   <root>
>       <priority value="debug"/>
>     <appender-ref ref="CONSOLE"/>
>     <appender-ref ref="FILE"/>
>   </root>
>   
> </log4j:configuration>
> ========================================================================
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Nicholas
> Sent: Tuesday, January 06, 2004 12:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Exclude a class from being logged to the
> appender
> 
> You can raise the priority of the specific class:
> 
> <category name="com.x.mynoisyclass"
> additivity="false">
>      <priority value="ERROR"/>
> </category>
> 
> //Nicholas
> 
> --- "Pitre, Russell" <[EMAIL PROTECTED]> wrote:
> > Does anyone know how I can EXCLUDE a certain class
> > from being logged to
> > the console appender.  This class logs a "ping"
> > message every 5 seconds
> > and I don't want to see the messages on the console
> > during development.
> > 
> > 
> >  
> > 
> >  
> > 
> > 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}]
> > %m%n"/>
> > 
> >     </layout>
> > 
> >   </appender>
> > 
> >  
> > 
> >  
> > 
> > Thanx Russ-
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> > 
> 
> 
> =====
> Nicholas Whitehead
> Home: (973) 377 9335
> Cell: (201) 615 2716
> [EMAIL PROTECTED]
> Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for
> IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys
> admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to