title: How to remove/disable/override appender from included file?
body: <p>We are using Spring Boot and are including org/springframework/boot/logging/logback/base.xml in our logback-spring.xml file. I need to override root logger to exclude/disable/override appenders declared in included file, in particular a CONSOLE appender (well, and remove FILE appender).</p>
  
  <p>I've tried declaring a root logger in logback-spring.xml with my own CONSOLE appender, but that only duplicates the output. I've tried declaring an empty root logger (to set a different logging level) and a new appender with the same name as included one ("CONSOLE"), but that is misleading (as root logger is empty) and still does not remove FILE appender.</p>
  
  <p>Misleading version of logback-spring.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE configuration&gt;
  
  &lt;configuration scan="true"&gt;
      &lt;include resource="org/springframework/boot/logging/logback/base.xml"/&gt;
      &lt;!-- bunch of loggers --&gt;
      &lt;appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder class="net.logstash.logback.encoder.LogstashEncoder" /&gt;
      &lt;/appender&gt;
      &lt;root level="ERROR"&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>What I would expect is something like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;include resource="org/springframework/boot/logging/logback/base.xml"/&gt;
      &lt;appender name="CUSTOM-CONSOLE" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder class="net.logstash.logback.encoder.LogstashEncoder" /&gt;
      &lt;/appender&gt;
      &lt;root level="ERROR"&gt;
          &lt;appender-ref ref="CUSTOM-CONSOLE"/&gt;
      &lt;/root&gt;
  </code></pre>
  
  <p>And then included CONSOLE and FILE appenders are not used.</p>
  
  <p>Or maybe re-declaring some dummy/no-op CONSOLE and FILE appenders to override included configuration.</p>
  
  <p>EDIT:
  My question is about appenders inherited from included file hence suggestions in <a href="https://stackoverflow.com/questions/19913160/can-i-disable-an-appender-in-logback">Can I disable an appender in logback?</a> don't really address the issue.</p>