title: Configuring Logback in Eclipse
body: <p>I'm in the process of switching from Log4j to Logback but I'm not having success at making Logback work yet. I have placed <code>logback.xml</code> in the root directory of my Eclipse Java project and below is its content:</p>
  
  <pre><code>&lt;configuration&gt;
  
    &lt;appender name="FILE" class="ch.qos.logback.core.FileAppender"&gt;
      &lt;file&gt;myApp.log&lt;/file&gt;
  
      &lt;encoder&gt;
        &lt;pattern&gt;%date %level [%thread] %logger{10} [%file:%line] %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
    &lt;/appender&gt;
  
    &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
      &lt;encoder&gt;
        &lt;pattern&gt;%msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
    &lt;/appender&gt;
  
    &lt;root level="debug"&gt;
      &lt;appender-ref ref="FILE" /&gt;
      &lt;appender-ref ref="STDOUT" /&gt;
    &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And below is the relevant content of my <code>Main.java</code>:</p>
  
  <pre><code>import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  public class Main
  {
    static final Logger logger = LoggerFactory.getLogger(Main.class);
  
    public static void main(String[] args)
    {
      logger.info("Main started");
    }
  }
  </code></pre>
  
  <p>This does not seem to be working as no file named <code>myApp.log</code> is created in the root of my Eclipse Java application. Any idea what I'm doing wrong?</p>