title: log different log levels to different files with log4j
body: <p>I am using log4j for logging in my applicaion. I am trying to different level logs in different files but something going wrong. Any help regrading this issue will be highly appreciated.</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
  
  &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
  
  &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt; 
      &lt;param name="Target" value="System.out"/&gt; 
      &lt;layout class="org.apache.log4j.PatternLayout"&gt; 
        &lt;param name="ConversionPattern" value="%-5p %c{1} - %m%n"/&gt; 
      &lt;/layout&gt; 
  &lt;/appender&gt; 
  
  &lt;appender name="DEBUG" class="org.apache.log4j.RollingFileAppender"&gt;
    &lt;param name="File" value="TCS_patch_9/log/retailer_debug.log" /&gt;
    &lt;param name="Threshold" value="DEBUG" /&gt;
    &lt;param name="MaxFileSize" value="2MB"/&gt;
    &lt;param name="MaxBackupIndex" value="3"/&gt;
    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;appender name="INFO" class="org.apache.log4j.RollingFileAppender"&gt;
    &lt;param name="File" value="TCS_patch_9/log/retailer_info.log" /&gt;
    &lt;param name="Threshold" value="INFO" /&gt;
    &lt;param name="MaxFileSize" value="2MB"/&gt;
    &lt;param name="MaxBackupIndex" value="3"/&gt;
    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  &lt;appender name="ERROR" class="org.apache.log4j.RollingFileAppender"&gt;
    &lt;param name="File" value="TCS_patch_9/log/retailer_error.log" /&gt;
    &lt;param name="Threshold" value="ERROR" /&gt;
    &lt;param name="MaxFileSize" value="2MB"/&gt;
    &lt;param name="MaxBackupIndex" value="3"/&gt;
    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  &lt;appender name="FATAL" class="org.apache.log4j.RollingFileAppender"&gt;
    &lt;param name="File" value="TCS_patch_9/log/retailer_repeat_delay.log" /&gt;
    &lt;param name="Threshold" value="FATAL" /&gt;
    &lt;param name="MaxFileSize" value="2MB"/&gt;
    &lt;param name="MaxBackupIndex" value="3"/&gt;
    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="ConversionPattern" value="%d{ISO8601} %-5p %c - %m%n"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  
    &lt;root&gt; 
      &lt;priority value ="error" /&gt; 
      &lt;appender-ref ref="console"/&gt; 
      &lt;appender-ref ref="DEBUG"/&gt; 
      &lt;appender-ref ref="INFO"/&gt; 
      &lt;appender-ref ref="ERROR"/&gt;
      &lt;appender-ref ref="FATAL"/&gt; 
    &lt;/root&gt;
  
  &lt;/log4j:configuration&gt;
  </code></pre>