title: Exclude default logback file
body: <p>My team is developing a telecom realtime application with high calls per second rate. <strong>We are using logback to filter log based on a key-value match (traffic live values</strong>, like Calling Party, and so on). The filtered log file is correctly created, once verified the match from live values and db values, but <strong>we would get rid of default file which is filled with logs when there is no match</strong>. It might happen that a traffic node needs to be monitored for a while before a key-value match takes place, so in the meantime the default could indefinitely increase in size and cause problems to performance and stability of node itself. <strong>What should I do in my logback.xml to avoid generation of default log file?</strong> Is it possible? Any other option to achieve same result?</p>
  
  <p><strong>logback.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;property scope="context" name="LOG_LEVEL" value="INFO" /&gt;
  
  &lt;appender name="SIFT_LOGGER" class="ch.qos.logback.classic.sift.SiftingAppender"&gt;
      &lt;discriminator class="com.ericsson.jee.ngin.services.log.ServiceKeyDiscriminator"&gt;
  
      &lt;/discriminator&gt;
      &lt;sift&gt;
  
          &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
  
              &lt;prudent&gt;true&lt;/prudent&gt;
              &lt;rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"&gt;                   
                  &lt;fileNamePattern&gt;/var/log/tit/logback_${serviceKey}_%d{yyyy-MM-dd}_%i.log&lt;/fileNamePattern&gt;
                  &lt;maxFileSize&gt;1MB&lt;/maxFileSize&gt;    
                  &lt;maxHistory&gt;10&lt;/maxHistory&gt;
                  &lt;totalSizeCap&gt;2GB&lt;/totalSizeCap&gt;
              &lt;/rollingPolicy&gt;
  
              &lt;filter class="ch.qos.logback.classic.filter.LevelFilter"&gt;
                  &lt;level&gt;${LOG_LEVEL}&lt;/level&gt;
                  &lt;onMatch&gt;ACCEPT&lt;/onMatch&gt;
                  &lt;onMismatch&gt;DENY&lt;/onMismatch&gt;
              &lt;/filter&gt;
  
              &lt;!-- encoders are by default assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder --&gt;
              &lt;encoder&gt;
                  &lt;pattern&gt; %d{yyyy-MM-dd HH:mm:ss.SSSZ} [%thread]  %-5level %logger{36} %msg%n&lt;/pattern&gt;
              &lt;/encoder&gt;
          &lt;/appender&gt; 
      &lt;/sift&gt;
  &lt;/appender&gt; 
  
  &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
      &lt;!-- encoders are by default assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder --&gt;
  
      &lt;encoder&gt;
          &lt;pattern&gt; %d{yyyy-MM-dd HH:mm:ss.SSSZ} [%thread] %-5level %logger{36} %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  
  &lt;/appender&gt; 
  
  &lt;turboFilter class="ch.qos.logback.classic.turbo.DynamicThresholdFilter"&gt;
      &lt;key&gt;serviceKey&lt;/key&gt;
      &lt;defaultThreshold&gt;DEBUG&lt;/defaultThreshold&gt;
      &lt;onHigherOrEqual&gt;ACCEPT&lt;/onHigherOrEqual&gt;
      &lt;onLower&gt;ACCEPT&lt;/onLower&gt;       
  
  &lt;/turboFilter&gt;
  
  &lt;root level="DEBUG"&gt;
      &lt;appender-ref ref="SIFT_LOGGER" /&gt;              
      &lt;appender-ref ref="STDOUT" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p></p>
  
  <p>ATTACHMENTS: <a href="http://www.figurinesportive.com/ericsson/FilteredLogback.java" rel="nofollow noreferrer">FILTERED LOGBACK CLASS</a></p>
  
  <p>The provided FL class is only working for a SK which has a java Discriminator in FL module.</p>