title: Setting package wide logger level via Logger
body: <p>I need to setup system that could log INFO and DEBUG log level information from selected packages (MyPck and MyPck1) to selected files in following way:</p>
  
  <pre><code>MyPck DEBUG goes to logFile
  MyPck1 INFO goes to logFile
  
  MyPck   INFO goes to debugLogFile
  MyPck1 DEBUG goes to debugLogFile
  </code></pre>
  
  <p>I try to do this with lines in Log4j.properties:</p>
  
  <pre><code>log4j.logger.MyPck=DEBUG,logFile
  log4j.logger.MyPck1=INFO,logFile
  
  log4j.logger.MyPck=INFO,debugLogFile
  log4j.logger.MyPck1=DEBUG,debugLogFile
  </code></pre>
  
  <p>Unfortuetly debugLogFile gets info and logFile remains empty. In case if I change lines in log4j.properties according order - first debugLogFile then logFile I will have debugLogFile empty. How to solve this problem?</p>
  
  <p>Whole Log4J.properties settings:</p>
  
  <pre><code>log4j.rootLogger=TRACE, defaultFile
  
  log4j.appender.defaultFile=org.apache.log4j.RollingFileAppender
  log4j.appender.defaultFile.File=defaultFile.log
  log4j.appender.defaultFile.Threshold=ALL
  log4j.appender.defaultFile.MaxFileSize=100MB
  log4j.appender.defaultFile.MaxBackupIndex=4
  log4j.appender.defaultFile.layout=org.apache.log4j.PatternLayout
  log4j.appender.defaultFile.layout.ConversionPattern=%d %-4r [%t] %-5p %c %x - %m%n
  log4j.appender.defaultFile.Append=false
  
  log4j.appender.logFile=org.apache.log4j.RollingFileAppender
  log4j.appender.logFile.File=logFile.log
  log4j.appender.logFile.Threshold=ALL
  log4j.appender.logFile.MaxFileSize=100MB
  log4j.appender.logFile.MaxBackupIndex=4
  log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
  log4j.appender.logFile.layout.ConversionPattern=%d %-4r [%t] %-5p %c %x - %m%n
  log4j.appender.logFile.Append=false
  
  log4j.appender.debugLogFile=org.apache.log4j.RollingFileAppender
  log4j.appender.debugLogFile.File=debugLogFile.log
  log4j.appender.debugLogFile.Threshold=ALL
  log4j.appender.debugLogFile.MaxFileSize=100MB
  log4j.appender.debugLogFile.MaxBackupIndex=4
  log4j.appender.debugLogFile.layout=org.apache.log4j.PatternLayout
  log4j.appender.debugLogFile.layout.ConversionPattern=%d %-4r [%t] %-5p %c %x - %m%n
  log4j.appender.debugLogFile.Append=false
  
  log4j.logger.MyPck=DEBUG,logFile
  log4j.logger.MyPck1=INFO,logFile
  
  log4j.logger.MyPck=INFO,debugLogFile
  log4j.logger.MyPck1=DEBUG,debugLogFile
  
  log4j.additivity.MyPck=false
  log4j.additivity.MyPck1=false
  </code></pre>
  
  <p>SOURCE CODE:</p>
  
  <p>Main class:</p>
  
  <pre><code>package tst_log4j;
  import org.apache.log4j.Logger;
  import MyPck.C;
  import MyPck1.C1;
  
  public class Tst_Log4J 
  {
  public final Logger log = Logger.getLogger(getClass());
  
      public static void main(String[] args) 
      {
          C c = new C();
          c.doLog();
          C1 c1 = new C1();
          c1.doLog();
      }
  }
  </code></pre>
  
  <p>MyPck class:</p>
  
  <pre><code>package MyPck;
  
  import org.apache.log4j.Logger;
  
  public class C {
  public final Logger log = Logger.getLogger(getClass());
  
  public void doLog()
      {
      log.info("aaa");
      log.debug("bbb");
      log.error("ccc");
  
      }
  
  
  }
  </code></pre>
  
  <p>MyPck1 class:</p>
  
  <pre><code>package MyPck1;
  
  import org.apache.log4j.Logger;
  
  public class C1 {
  public final Logger log = Logger.getLogger(getClass());
  
  public void doLog()
      {
      log.info("aaa");
      log.debug("bbb");
      log.error("ccc");
  
      }
  
  }
  </code></pre>