title: tomcat 7 internal logging with log4j2.xml
body: <p>I am trying to configure tomcat 7 internal logging with <code>log4j2</code>. I have followed the answer provided at <a href="https://stackoverflow.com/questions/25326414/logging-server-classes-in-tomcat-6-with-log4j2">Logging server classes in Tomcat 6 with log4j2</a>.</p>
  
  <p>I am using tomcat 7.0.54, and <code>log4j-core-2.1.jar</code>, <code>log4j-api-2.1.jar</code>.
  I have down loaded the extras and did all the steps below, but when I start tomcat, I get an error:</p>
  
  <pre><code>ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
  </code></pre>
  
  <p>These are the steps I performed:</p>
  
  <ul>
  <li>put <code>log4j2.xml</code> in <code>$CATALINA_BASE/lib</code> </li>
  <li>download <code>tomcat-juli.jar</code> and <code>tomcat-juli-adapters.jar</code> from "extras"</li>
  <li>put <code>log4j-api-2.1.jar</code>, <code>log4j-core-2.1.jar</code>, <code>log4j-jul-2.1.jar</code>, and <code>tomcat-juli-adapters.jar</code> from "extras" into <code>$CATALINA_HOME/lib</code>.</li>
  <li>replace <code>$CATALINA_HOME/bin/tomcat-juli.jar</code> with <code>tomcat-juli.jar</code> from "extras".</li>
  <li>delete <code>$CATALINA_BASE/conf/logging.properties</code></li>
  <li>set the logging manager to use the manager from the <code>log4j2-jul</code> bridge (<code>log4j-jul-2.1.jar</code>). Alter <code>catalina.sh</code> to ensure that the classpath includes <code>bin/tomcat-juli.jar</code>, <code>lib/log4j-jul-2.1.jar</code>, <code>lib/log4j-api-2.1.jar</code> and <code>lib/log4j-core-2.1.jar</code>, and the command used to start tomcat includes
  -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager`</li>
  </ul>
  
  <p>I even tried adding this (<code>LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_HOME/lib/log4j2.xml"</code>) in <code>catalina.sh</code> but didn't work.</p>
  
  <p>Please let me know if anyone could configure it successfully.</p>