title: log4j appender threshold and category
body: <p>Let me preface this question by saying I've exhausted Google, or at least what I've been trying to search for. "log4j threshold", "log4j threshold category", "log4j appender threshold category", etc.  But I really don't understand the results I'm getting back from Google.  </p>
  
  <p>This is the full configuration I've been given.  I can't figure out how to modify it to suit my needs.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
  
  &lt;!-- ===================================================================== --&gt;
  &lt;!--                                                                       --&gt;
  &lt;!--  Log4j Configuration                                                  --&gt;
  &lt;!--                                                                       --&gt;
  &lt;!-- ===================================================================== --&gt;
  
  &lt;!-- $Id: jboss-log4j.xml 62403 2007-04-18 15:26:43Z dimitris@jboss.org $ --&gt;
  
  &lt;!--
  | For more configuration infromation and examples see the Jakarta Log4j
  | owebsite: http://jakarta.apache.org/log4j
   --&gt;
  
  &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"&gt;
  
  &lt;!-- ================================= --&gt;
  &lt;!-- Preserve messages in a local file --&gt;
  &lt;!-- ================================= --&gt;
  
  &lt;appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"&gt;
    &lt;errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/&gt;
    &lt;param name="File" value="${jboss.server.log.dir}/server.log"/&gt;
    &lt;param name="Append" value="false"/&gt;
  
    &lt;!-- Rollover at midnight each day --&gt;
    &lt;param name="DatePattern" value="'.'yyyy-MM-dd"/&gt;
  
    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
       &lt;param name="ConversionPattern" value="%d %-5p [%c] %m%n"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  
  
  &lt;!-- ============================== --&gt;
  &lt;!-- Append messages to the console --&gt;
  &lt;!-- ============================== --&gt;
  
  &lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt;
    &lt;errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/&gt;
    &lt;param name="Target" value="System.out"/&gt;
    &lt;param name="Threshold" value="DEBUG"/&gt;
  
    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
       &lt;!-- The default pattern: Date Priority [Category] Message\n --&gt;
       &lt;param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c] %m%n"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  
  
  
  &lt;!-- ================ --&gt;
  &lt;!-- Limit categories --&gt;
  &lt;!-- ================ --&gt;
  
  &lt;category name="com.arjuna"&gt;
    &lt;priority value="FATAL"/&gt;
  &lt;/category&gt;   
  
  &lt;category name="com.sun.facelets"&gt;
    &lt;priority value="ERROR"/&gt;
  &lt;/category&gt;   
  
   &lt;category name="jacorb"&gt;
     &lt;priority value="FATAL"/&gt;
   &lt;/category&gt;
  
  &lt;category name="javax.enterprise.resource"&gt;
    &lt;priority value="WARNING"/&gt;
   &lt;/category&gt;  
  
   &lt;category name="javax.enterprise.resource.webcontainer.jsf"&gt;
      &lt;priority value="WARNING"/&gt;
   &lt;/category&gt;  
  
   &lt;category name="org.apache"&gt;
      &lt;priority value="FATAL"/&gt;
   &lt;/category&gt;
  
   &lt;category name="org.hibernate"&gt;
      &lt;priority value="FATAL"/&gt;
   &lt;/category&gt;   
  
   &lt;category name="org.jboss"&gt;
      &lt;priority value="INFO"/&gt;
   &lt;/category&gt;
  
  &lt;category name="org.jboss.ejb3.EJB3Deployer"&gt;
      &lt;priority value="WARNING" /&gt;
  &lt;/category&gt;
  
  &lt;category name="org.jboss.ejb3.JmxKernelAbstraction"&gt;
      &lt;priority value="WARNING" /&gt;
  &lt;/category&gt;
  
  &lt;category name="org.jboss.management"&gt;
     &lt;priority value="FATAL"/&gt;
  &lt;/category&gt;
  
  &lt;category name="org.jboss.serial"&gt;
    &lt;priority value="FATAL"/&gt;
  &lt;/category&gt;
  
  &lt;category name="org.jboss.wsf.framework"&gt;
     &lt;priority value="FATAL"/&gt;
  &lt;/category&gt;   
  
  &lt;category name="org.jgroups"&gt;
     &lt;priority value="FATAL"/&gt;
  &lt;/category&gt;
  
  &lt;category name="org.quartz"&gt;
      &lt;priority value="FATAL" /&gt;
  &lt;/category&gt;
  &lt;!-- ======================= --&gt;
  &lt;!-- Setup the Root category --&gt;
  &lt;!-- ======================= --&gt;
  
  &lt;root&gt;
     &lt;appender-ref ref="CONSOLE"/&gt;
     &lt;appender-ref ref="FILE"/&gt;
  &lt;/root&gt;
  
  
  
  &lt;/log4j:configuration&gt;
  </code></pre>
  
  <p>I don't understand how the appender's "threshold" level interacts with the categories.  See, I only want com.foo.bar messages to show on the console.  But it seems like I'm getting a lot more than that, for instance, org.jboss.wsf.framework is dumping out DEBUG messages, even though I have a category with a name that matches it and set to FATAL.  </p>
  
  <p>I'm certain I'm manipulating the correct config file, as jboss reports it's reloading the config after I change it.  So how do I set the category/threshold levels right?  What's the difference between the threshold and category?  </p>
  
  <p>Example output (snipped).  Why does quartz show up on the console when I have it set to FATAL? </p>
  
  <pre><code>2009-06-22 00:58:37,666 INFO  [org.quartz.plugins.history.LoggingJobHistoryPlugin] Job JobInitializationPlugin.JobInitializationPlugin_jobInitializer execution complete at  00:58:37 06/22/2009 and reports: null
  2009-06-22 01:08:37,669 DEBUG [org.quartz.simpl.SimpleJobFactory] Producing instance of Job 'JobInitializationPlugin.JobInitializationPlugin_jobInitializer', class=org.quartz.jobs.FileScanJob
  2009-06-23 15:44:17,790 INFO  [org.jboss.wsf.stack.jbws.NativeServerConfig] 3.0.5.GA
  2009-06-23 15:44:17,868 DEBUG [org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl] setDeploymentAspects on WSDeploymentAspectManagerEJB
  2009-06-23 15:44:17,868 DEBUG [org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl] setDeploymentAspects on WSDeploymentAspectManagerEndpointAPI
  </code></pre>