title: create two log files using RollingFileAppender in log4j.xml
body: <p>My <code>log4j.xml</code> configuration was like ,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" &gt;
  
  &lt;log4j:configuration&gt;
  
  
      &lt;appender name="fileAppender1" class="org.apache.log4j.RollingFileAppender"&gt;
  
          &lt;param name="Threshold" value="ALL" /&gt;
          &lt;param name="MaxFileSize" value="3KB" /&gt;
          &lt;param name="MaxBackupIndex" value="10" /&gt;
          &lt;param name="File" value="F:/logs/Testing/Project_moduleOne.log" /&gt;
  
          &lt;layout class="org.apache.log4j.PatternLayout"&gt;
              &lt;param name="ConversionPattern" value="%d{MMM-dd-yyyy HH:mm:ss:SSS} %-5p %m%n" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
  
      &lt;appender name="fileAppender2" class="org.apache.log4j.RollingFileAppender"&gt;
  
          &lt;param name="Threshold" value="ALL" /&gt;
          &lt;param name="MaxFileSize" value="3KB" /&gt;
          &lt;param name="MaxBackupIndex" value="10" /&gt;
          &lt;param name="File" value="F:/logs/PAD_Testing/Project_moduleTwo.log" /&gt;
  
  
          &lt;layout class="org.apache.log4j.PatternLayout"&gt;
              &lt;param name="ConversionPattern" value="%d{MMM-dd-yyyy HH:mm:ss:SSS} %-5p %m%n" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
  
  
      &lt;!--sets the priority log level for org.springframework --&gt;
      &lt;logger name="com.comp.logger1"&gt;
           &lt;appender ref="fileAppender1"/&gt;
      &lt;/logger&gt;
  
  
      &lt;logger name="com.comp.logger2"&gt;
          &lt;appender ref="fileAppender2" /&gt;
      &lt;/logger&gt;
  
  
      &lt;!--sets the default priority log level --&gt;
      &lt;root&gt;
          &lt;priority value="all"&gt;&lt;/priority&gt;
          &lt;appender-ref ref="fileAppender1" /&gt;
          &lt;appender-ref ref="fileAppender2" /&gt;
      &lt;/root&gt;
  
  &lt;/log4j:configuration&gt;
  </code></pre>
  
  <p>And two log files also created in the specified location.</p>
  
  <p>I need to know how to log two different data's in these two different log_files independently in <code>JAVA</code> class.</p>
  
  <p>For example,</p>
  
  <pre><code>Logger logOne = Logger.getLogger("com.comp.logger1");
  Logger logTwo = Logger.getLogger("com.comp.logger2");
  </code></pre>
  
  <p>The above code is not working for me.  All the log informations are logged to both the created two log files. I need the separation of logging data.</p>
  
  <p><strong>My need is</strong> ,</p>
  
  <ol>
  <li><p>I want to create two log file. Because my project has two modules and log each module in separate log files.</p></li>
  <li><p>After that , I have to log each module logging data independently .</p></li>
  <li><p>Please make sure I used the logger name for logging in my java class correctly.</p></li>
  </ol>
  
  <p>Any new or complete examples using log4j.xml are greatly appreciated.</p>
  
  <p><strong>EDIT :</strong> </p>
  
  <p>If I add the  <strong>additivity="false"</strong> in the logger as,</p>
  
  <pre><code>&lt;logger name="com.comp.logger1" additivity="false"&gt;
       &lt;appender ref="fileAppender1" /&gt; 
  &lt;/logger&gt;
  
  
  &lt;logger name="com.comp.logger2" additivity="false"&gt;
      &lt;appender ref="fileAppender2" /&gt;
  &lt;/logger&gt;
  </code></pre>
  
  <p>The log data didn't logged in the created log file.The log file was empty.</p>
  
  <p>Please make sure my <code>&lt;root&gt;...&lt;/root&gt;</code> is correct.</p>