title: Empty maven project with SLF4J reference has log4j "No appenders could be found" warning
body: <p>This question seems to be related to <a href="https://stackoverflow.com/questions/14325508/using-logback-but-log4j-started-displaying-warn-no-appenders">Using Logback but Log4j started displaying WARN no Appenders</a>, but the answer there doesn't seem resolve this for me.</p>
  
  <p>When I create a maven project with NO dependencies other than slf4j, I get a warning:</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (com.example.App).
  log4j:WARN Please initialize the log4j system properly.
  </code></pre>
  
  <p>Steps:</p>
  
  <p>In an empty directory, execute</p>
  
  <pre><code>mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart
  
  Define value for property 'groupId': : com.example
  Define value for property 'artifactId': : slf4jtest
  Define value for property 'version':  1.0-SNAPSHOT: : 
  Define value for property 'package':  com.example: : 
  </code></pre>
  
  <p>Add SLF4J to pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;com.example&lt;/groupId&gt;
    &lt;artifactId&gt;slf4jtest&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;slf4jtest&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
            &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
            &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
            &lt;version&gt;1.7.2&lt;/version&gt;
        &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
      &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
      &lt;version&gt;1.7.2&lt;/version&gt;
  &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Invoke the logger in App.java</p>
  
  <pre><code>package com.example;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  /**
   * Hello world!
   *
   */
  public class App 
  {
      public static void main( String[] args )
      {
          Logger logger = LoggerFactory.getLogger(App.class);
          logger.debug("hello");
          System.out.println( "Hello World!" );
      }
  }
  </code></pre>
  
  <p>Execute:</p>
  
  <pre><code>mvn package
  </code></pre>
  
  <p>Execute:</p>
  
  <pre><code>mvn exec:java -Dexec.mainClass="com.example.App"
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (com.example.App).
  log4j:WARN Please initialize the log4j system properly.
  Hello World!
  </code></pre>
  
  <p>log4j is not listed as a dependency:</p>
  
  <pre><code>$ mvn dependency:tree
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building slf4jtest 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ slf4jtest ---
  [INFO] com.example:slf4jtest:jar:1.0-SNAPSHOT
  [INFO] +- junit:junit:jar:3.8.1:test
  [INFO] \- org.slf4j:slf4j-api:jar:1.7.2:compile
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.872s
  [INFO] Finished at: Tue Feb 19 11:23:33 EST 2013
  [INFO] Final Memory: 5M/81M
  [INFO] ------------------------------------------------------------------------
  </code></pre>