title: Using RollingFileAppender ,DailyRollingFileAppender,ConsoleAppender in log4j. Not working
body: <p>My requirement is to log the messages to 3 separate log files. </p>
  
  <p>I am using 3 appenders in a JBOSS server. </p>
  
  <p>Three of them need to work in the way such as 
  1.RollingFileAppender, consoleAppender work for 'INFO' and 'ERROR' modes.
  2.DailyRollingFileAppender for 'ERROR' mode and for a specific category only.</p>
  
  <p>I have tried lots of combinations like changing the priority value and the categories, but I have so far found no way in which all the three work simulatneously. Either fileAppender and ConsoleAppender work(logging both ERRROR and INFO) and the DailyRollingFileAppender does not or DailyRollingFileAppender  does but the other two log only ERRORS not INFO.</p>
  
  <p>Please tell me a way so that the three of them work.</p>
  
  <p>Below mentioned is the log4j.xml I am using.</p>
  
  <pre><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;!--  --&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;!-- file appender --&gt;
    &lt;appender name="fileAppender" class="org.apache.log4j.RollingFileAppender"&gt;
      &lt;param name="file" value="C:/logs/mdmWSServer.log" /&gt; 
      &lt;param name="MaxBackupIndex" value="5" /&gt;
      &lt;param name="MaxFileSize" value="5MB" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
           &lt;param name="ConversionPattern" value="[%d{ISO8601}] [%t] [%-5p][ %c:] %m%n"/&gt;
      &lt;/layout&gt;
    &lt;/appender&gt; 
  
       &lt;appender name="dailyFileAppender" class="org.apache.log4j.DailyRollingFileAppender"&gt;
        &lt;param name="file" value="C:/logs/dailyApp.log"/&gt;
      &lt;param name="MaxBackupIndex" value="5" /&gt;
      &lt;param name="MaxFileSize" value="5MB" /&gt;
       &lt;param name="DatePattern" value="'.'yyyy-MM-dd-HH" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;       
          &lt;param name="ConversionPattern" value="[%d{ISO8601}] [%t] [%-5p][%c:] %m%n"/&gt;
      &lt;/layout&gt;
    &lt;/appender&gt; 
  
    &lt;appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender"&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="[%d{ISO8601}] [%t] %m%n"/&gt;
      &lt;/layout&gt;
    &lt;/appender&gt; 
  
     &lt;category name="com"&gt;
        &lt;priority value="INFO"/&gt;
        &lt;appender-ref ref="fileAppender"/&gt;
        &lt;appender-ref ref="consoleAppender"/&gt;
    &lt;/category&gt; 
      &lt;category name="com.gsk"&gt;    
      &lt;priority value="ERROR"/&gt;
        &lt;appender-ref ref="dailyFileAppender"/&gt;
    &lt;/category&gt;
    &lt;category name="org.apache"&gt;
        &lt;priority value="INFO"/&gt;
        &lt;appender-ref ref="fileAppender"/&gt;
    &lt;/category&gt;
  
    &lt;root&gt;
      &lt;priority value="DEBUG"/&gt;
      &lt;appender-ref ref="fileAppender"/&gt;
      &lt;appender-ref ref="consoleAppender"/&gt;
    &lt;/root&gt;
  &lt;/log4j:configuration&gt;
  </code></pre>