title: Spring not using log4j2.xml configuration over slf4j
body: <p>I'm updating one of my applications to Log4J2 over SLF4J and I'm running into troubles with Spring.</p>
  
  <p>Additionally to the "normal" (correct) logging output</p>
  
  <pre><code>2013-05-24 20:02:00,490 INFO  [main] application.Application (Application.java:33) - Application started with arguments []
  </code></pre>
  
  <p>I'm getting lines like this </p>
  
  <pre><code>Mai 24, 2013 8:02:00 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5dfb3d5c: startup date [Fri May 24 20:02:00 CEST 2013]; root of context hierarchy
  </code></pre>
  
  <p>on System.err, so spring is not logging using my Log4J2 configuration.</p>
  
  <p>These are my configuration files:</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;slf4j.version&gt;1.7.4&lt;/slf4j.version&gt;
  &lt;log4j.version&gt;2.0-beta6&lt;/log4j.version&gt;
  
  ...
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
      &lt;version&gt;${slf4j.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
      &lt;version&gt;${log4j.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
      &lt;version&gt;${log4j.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j-slf4j-impl&lt;/artifactId&gt;
      &lt;version&gt;${log4j.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>log4j2.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;appenders&gt;
          &lt;File name="file" fileName="error.log" append="true"&gt;
              &lt;PatternLayout pattern="%t %-5p %c{2} - %m%n"/&gt;
          &lt;/File&gt;
          &lt;Console name="console" target="SYSTEM_OUT"&gt;
              &lt;PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/&gt;
          &lt;/Console&gt;
      &lt;/appenders&gt;
      &lt;loggers&gt;
          &lt;root level="all"&gt;
              &lt;appender-ref ref="file"/&gt;
              &lt;appender-ref ref="console"/&gt;
          &lt;/root&gt;
          &lt;logger name="org.springframework" level="error"&gt;
              &lt;appender-ref ref="file"/&gt;
              &lt;appender-ref ref="console"/&gt;
          &lt;/logger&gt;
      &lt;/loggers&gt;
  &lt;/configuration&gt;
  </code></pre>