title: Logging server classes in Tomcat 6 with log4j2
body: <p>I am hoping to use log4j2 to log from both my web applications and the server (tomcat 6) itself, ideally all to the same file. The config I have works fine for the web applications, but not for the server classes.</p>
  
  <p>What I want is for lines like the following to be written to a file,  (they are currently written to the console only)</p>
  
  <pre><code>Aug 15, 2014 1:03:24 PM org.apache.coyote.http11.Http11Protocol start
  INFO: Starting Coyote HTTP/1.1 on http-80
  Aug 15, 2014 1:03:24 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 1287 ms
  </code></pre>
  
  <p>I have log4j-api-2.0.1.jar, log4j-core-2.0.1.jar and log4j2.xml in the tomcat/lib directory. A stripped down log4j2.xml is shown below. I don't see any problems in the information given by having status="all". log4j2 is setting itself up automatically - I am not passing in a configurationFile with CATALINA_OPTS.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="all"&gt;
      &lt;Appenders&gt;
          &lt;RollingFile name="R" fileName="../logs/general.log" filePattern="../logs/general-%d{yyyy-MM-dd}.log" append="true"&gt;
              &lt;PatternLayout&gt;
                  &lt;Pattern&gt;%d %p %c{1.} [%t] %m %ex%n&lt;/Pattern&gt;
              &lt;/PatternLayout&gt;
              &lt;Policies&gt;
                  &lt;TimeBasedTriggeringPolicy /&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy max="1000"/&gt;
          &lt;/RollingFile&gt;
          &lt;Console name="STDOUT" 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="info"&gt;
              &lt;AppenderRef ref="R" level="info"/&gt;
              &lt;AppenderRef ref="STDOUT" level="error"/&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>Any idea what I am doing wrong?</p>