title: How to configure slf4j with logback for a WebApp running Tomcat
body: <p>I have a WebApp that I develop using NetBeans 7.4.
  I deploy it on a Linux server running Tomcat 7.0.47.</p>
  <p>I am trying to have a decent logging mechanism with slf4j and logback.</p>
  <p>My project uses the following jars:</p>
  <ul>
  <li>slf4j-api-1.7.6.jar</li>
  <li>logback-classic-1.1.1.jar</li>
  <li>logback-core-1.1.1.jar</li>
  </ul>
  <p>My app is a SOAP server. At the head of the service class I put:</p>
  <blockquote>
  <p>private static final String nameOfLogger = MatrixSoapService.class.getName();</p>
  <p>private static final Logger soapLogger = LoggerFactory.getLogger(nameOfLogger);</p>
  </blockquote>
  <p>then when I need to log something:</p>
  <blockquote>
  <p>soapLogger.info(&quot;Init&quot;);</p>
  </blockquote>
  <p>etc...</p>
  <p>Ok. That's for the context.</p>
  <p>My question is: how do I configure this to have rolling logs in my $CATALINE_HOME/conf folder for this application?</p>
  <p>I thought I only needed to create a simple logback.xml file in the src folder of my webapp like this, but to no avail. I have no log generated.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;configuration&gt;
   
    &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
      &lt;layout class=&quot;ch.qos.logback.classic.PatternLayout&quot;&gt;
        &lt;Pattern&gt;mySOAP - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n&lt;/Pattern&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;
     
    &lt;logger name=&quot;com.xxx&quot; level=&quot;TRACE&quot;/&gt;
   
    &lt;root level=&quot;debug&quot;&gt;
      &lt;appender-ref ref=&quot;STDOUT&quot; /&gt;
    &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>