title: log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment)
body: <p>I am trying configure the log4j in my spring project, but after include this in my pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j&lt;/artifactId&gt;
      &lt;version&gt;1.2.17&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and this file log4j2.xml in my classpath:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
    &lt;Appenders&gt;
      &lt;Console name="Console" target="SYSTEM_OUT"&gt;
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
      &lt;/Console&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
      &lt;Root level="error"&gt;
        &lt;AppenderRef ref="Console"/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>when I deploy the application, this message is displayed in the console (and no log message):</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  </code></pre>
  
  <p>I visit the indicated link, but the info in it don't help me.</p>
  
  <p>Anyone knows what I miss?</p>
  
  <p>ps.: In my classes, I add this line too:</p>
  
  <pre><code>static final Logger logger = LogManager.getLogger(AcessoService.class.getName());
  </code></pre>
  
  <p>and add:</p>
  
  <pre><code>logger.error(...);
  </code></pre>
  
  <p>in the places I wanted, but as I said, no log message is displayed in the console.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Now I correct the name of the file to log4j.xml and the error message change to:</p>
  
  <pre><code>log4j:WARN Continuable parsing error 2 and column 30
  log4j:WARN O elemento-raiz do documento "Configuration" deve corresponder à raiz de DOCTYPE "null".
  log4j:WARN Continuable parsing error 2 and column 30
  log4j:WARN O documento é inválido: nenhuma gramática encontrada.
  log4j:ERROR DOM element is - not a &lt;log4j:configuration&gt; element.
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>the file below corrects the second error, but I returned to the first one I post here:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN" debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
    &lt;Appenders&gt;
      &lt;Console name="Console" target="SYSTEM_OUT"&gt;
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
      &lt;/Console&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
      &lt;Root level="error"&gt;
        &lt;AppenderRef ref="Console"/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>