title: Tomcat Log4J problem - no appenders could be found
body: <p>We have a very simple log4j setup for tomcat. We have only a single log4j.properties file and have added the debug flag at startup to verify that the correct log4j.properties file is being used.</p>
  
  <p>Here is our configuration:</p>
  
  <pre><code>log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.Target=System.out
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %.20t:%c{1}:%L - %m%n
  log4j.appender.stdout2=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout2.Target=System.out
  log4j.appender.stdout2.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout2.layout.ConversionPattern=%d{ABSOLUTE} %5p %.20t:%c{1}:%L - %m%n
  
  log4j.rootLogger=INFO, stdout
  log4j.logger.com.rei.framework.model.Table=INFO, stdout2
  log4j.logger.com.rei.framework.view.SqlGridDisplayGroup=WARN, stdout2
  </code></pre>
  
  <p>The problem we are having is that unless I specifically list a logger for each class I get this error:</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (com.rei.util.DatabaseConnection).
  log4j:WARN Please initialize the log4j system properly.
  </code></pre>
  
  <p>According to the docs the ROOT logger should be the default logger for any classes without a specific configuration line, yet I get many "No appenders found" warnings if I don't enumerate each class in the configuration. With hundreds of classes in our project this is not maintainable.</p>
  
  <p>We instantiate the logger this way inside each class:</p>
  
  <pre><code>static Logger logger = org.apache.log4j.Logger.getLogger(Myclass.class);
  </code></pre>
  
  <p>Any ideas why the root logger in this configuration is not being picked up for undefined classes?</p>