title: file and stdout appenders in logback.xml
body: <p>I have 2 <code>logback.xml</code> files in separate projects. One logs JDBC SQL to a file using a FileAppender and the other logs errors to stdout using a ConsoleAppender.</p>
  
  <p>Here are my logback.xml files for each.</p>
  
  <p><strong>File logging</strong></p>
  
  <pre><code>&lt;configuration&gt;
      &lt;appender name="FILE" class="ch.qos.logback.core.FileAppender"&gt;
          &lt;file&gt;${user.home}/database.log&lt;/file&gt;
          &lt;append&gt;false&lt;/append&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%-5relative %-5level %logger{35} - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;logger name="jdbc" level="OFF" /&gt;
      &lt;logger name="jdbc.sqlonly" level="debug" /&gt;
  
      &lt;root level="info"&gt;
          &lt;appender-ref ref="FILE" /&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>Console logging</strong></p>
  
  <pre><code>&lt;configuration&gt;
      &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%-5relative %-5level %logger{35} - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;logger name="jdbc" level="OFF" /&gt;
  
      &lt;root level="ERROR"&gt;
          &lt;appender-ref ref="STDOUT" /&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I am merging these two projects and I want to be able to continue logging the info level SQL to the file and the errors to STDOUT.</p>
  
  <p>I have added the two appenders to the <code>logback.xml</code> but I am not sure what to do with loggers and the root tags in my new <code>logback.xml</code>.</p>