title: Log4j 1.2 multi-level filtering
body: <p>BTW, this is log4j 1.2.</p>
  
  <p>My application needs to log every time we create an alert, and we want to do it at INFO level.  Our root logger has priority level set to INFO. So far so good.  We have added several appenders for specialized needs, including a stadard CONSOLE appender and a server.log appender (and others). I have configured the root logger with the console and server.log appenders.  Also fine up to this point.</p>
  
  <pre><code>   &lt;root&gt;
        &lt;priority value="INFO"/&gt;
        &lt;appender-ref ref="CONSOLE"/&gt;
        &lt;appender-ref ref="server"/&gt;
        &lt;appender-ref ref="logfileForErrors"/&gt;
     &lt;/root&gt;
  </code></pre>
  
  <p>Now I need a new appender that gets all of ERROR/WARNING/FATAL that normally goes to server.log, but also INFOs for a specific class.  I started with an appender with threshold of INFO so I could accept the alarm INFO logs:</p>
  
  <pre><code>&lt;appender name="logfileForAlarmsAndOther" class="org.apache.log4j.RollingFileAppender"&gt;
      &lt;errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/&gt;
      &lt;param name="file" value="${biomerieux.data}/simon/logs/vilink.log" /&gt;
      &lt;param name="append" value="true" /&gt;
      &lt;param name="threshold" value="INFO" /&gt;
      &lt;param name="maxBackupIndex" value="1" /&gt;
  &lt;/appender&gt;
  </code></pre>
  
  <p>Then I defined a logger for my class:</p>
  
  <pre><code>    &lt;logger name="my.root.path.service.alert.AlertService" additivity="false"&gt;
          &lt;level value="info" /&gt;
          &lt;appender-ref ref="logfileForAlarmsAndOther"/&gt;
          &lt;appender-ref ref="CONSOLE"/&gt;
          &lt;appender-ref ref="server"/&gt;
      &lt;/logger&gt;
  </code></pre>
  
  <p>So I successfully get my alert logs in all of the listed logs (a lot of work for nothing since the root was already at INFO).  But what I really want is to now get INFOs at my new appender <em>only</em> if they are from the one specific class.</p>
  
  <p>I am not sure I have described this well, and I am not log4j savvy, so please ask for clarifications if needed.  The conundrum has to do with limiting my new appender to WARNING and greater, except I <em>also</em> want INFOs from a specific class.  And these INFOs for this class should also go to every appender that parent loggeres would normally log INFOs.  I may be confused, but it seems like a custom filter is all I can think of to work in log4j 1.2.</p>