title: Tomcat Logging With Slf4j and Log4j
body: <p>I've got a web-app deployed to a <code>Tomcat 7</code> server.  My application uses <code>log4j</code> and a <code>file appender</code>.  However, not all logging messages are getting written to the file.</p>
  
  <p>On my classpath, I have:</p>
  
  <pre><code>log4j-1.2.14.jar
  slf4j-api-1.6.1.jar
  slf4j-log4j12-1.6.1.jar
  </code></pre>
  
  <p>My <code>log4j.properties</code> file is working fine on my local machine and is deploy properly.</p>
  
  <p>I see application generated error messages being written to <code>catalina.out</code> that are not getting written to my <code>log4j log</code>.  The log messages in <code>catalina.out</code> look to be coming from some other logging framework because the output pattern is in a different format than my <code>log4j</code> pattern.  The logging that I'm seeing in the <code>catalina.log</code> is like:</p>
  
  <pre><code>Nov 4, 2011 11:05:31 AM org.apache.myfaces.shared_impl.util.StateUtils reconstruct
  SEVERE
  </code></pre>
  
  <p>And my log4j pattern is like:</p>
  
  <pre><code>2011-11-03 16:42:09,336 ["http-bio-8080"-exec-13] ERROR
  </code></pre>
  
  <p>Some logging appears in my <code>log4j</code> file log, but not all of it.  From what I've read, <code>slf4j</code> just needs those jars for it to funnel log output.  Any ideas?</p>