title: How to exclude error log level in a file logback spring boot
body: <p>I have a spring boot app(spring-boot-starter-parent --&gt; 2.3.0.RELEASE) that I am implementing log.</p>
  <p>Basically what I am trying to achieve is that I have 2 log files one bridgeError.log which contains only error messages and bridge.log which will contain all log level <strong>except</strong> <strong>Error level</strong> since it is being logged in brideError.log file.</p>
  <p>I am able to create 2 logs file brideError.log which contains only error messages but the issue is that
  bridge.log also contains error messages.</p>
  <p>Please find my logback-spring.xml configuration below:</p>
  <pre><code>&lt;configuration&gt;
  
      &lt;property name=&quot;HOME_LOG&quot; value=&quot;logs/bridge.log&quot;/&gt;
      &lt;property name=&quot;HOME_LOG_ERROR&quot; value=&quot;logs/bridgeError.log&quot;/&gt;
  
  
      &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
          &lt;!-- encoders are assigned the type
               ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;appender name=&quot;FILE-ROLLING&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;
          &lt;file&gt;${HOME_LOG}&lt;/file&gt;
  
          &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;
              &lt;level&gt;DEBUG&lt;/level&gt;
          &lt;/filter&gt;
  
          &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy&quot;&gt;
              &lt;fileNamePattern&gt;logs/archived/bridge.%d{yyyy-MM-dd}.%i.log.gz&lt;/fileNamePattern&gt;
              &lt;!-- each archived file, size max 10MB --&gt;
              &lt;maxFileSize&gt;10MB&lt;/maxFileSize&gt;
              &lt;!-- total size of all archive files, if total size &gt; 20GB, it will delete old archived file --&gt;
              &lt;totalSizeCap&gt;20GB&lt;/totalSizeCap&gt;
              &lt;!-- 60 days to keep --&gt;
              &lt;maxHistory&gt;60&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
  
          &lt;encoder&gt;
              &lt;pattern&gt;%d %p %c{1.} [%t] %m%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
  
      &lt;appender name=&quot;FILE-ROLLING-ERROR&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;
          &lt;file&gt;${HOME_LOG_ERROR}&lt;/file&gt;
  
          &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;
              &lt;level&gt;ERROR&lt;/level&gt;
          &lt;/filter&gt;
  
          &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy&quot;&gt;
              &lt;fileNamePattern&gt;logs/archived/bridgeError.%d{yyyy-MM-dd}.%i.log.gz&lt;/fileNamePattern&gt;
              &lt;!-- each archived file, size max 10MB --&gt;
              &lt;maxFileSize&gt;10MB&lt;/maxFileSize&gt;
              &lt;!-- total size of all archive files, if total size &gt; 20GB, it will delete old archived file --&gt;
              &lt;totalSizeCap&gt;20GB&lt;/totalSizeCap&gt;
              &lt;!-- 60 days to keep --&gt;
              &lt;maxHistory&gt;60&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
  
          &lt;encoder&gt;
              &lt;pattern&gt;%d %p %c{1.} [%t] %m%n&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;appender name=&quot;CONSOLE&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
          &lt;layout class=&quot;ch.qos.logback.classic.PatternLayout&quot;&gt;
              &lt;Pattern&gt;
                  %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
              &lt;/Pattern&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
    
          &lt;logger name=&quot;com.dummy.package&quot; level=&quot;debug&quot; additivity=&quot;false&quot;&gt;
              &lt;!--        &lt;appender-ref ref=&quot;FILE-ROLLING&quot;/&gt;--&gt;
              &lt;appender-ref ref=&quot;CONSOLE&quot;/&gt;
          &lt;/logger&gt;
  
  
      &lt;!--    &lt;root level=&quot;error&quot;&gt;
              &lt;appender-ref ref=&quot;FILE-ROLLING&quot;/&gt;
              &amp;lt;!&amp;ndash;  &lt;appender-ref ref=&quot;CONSOLE&quot;/&gt;&amp;ndash;&amp;gt;
          &lt;/root&gt;--&gt;
  
      &lt;logger name=&quot;com.dummy.package&quot; level=&quot;DEBUG&quot;&gt;
          &lt;appender-ref ref=&quot;FILE-ROLLING&quot;/&gt;
          &lt;appender-ref ref=&quot;FILE-ROLLING-ERROR&quot;/&gt;
      &lt;/logger&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  <p>Is it possible to exclude error messages in bridge.log file?</p>
  <p>Thanks in advance</p>