title: Dropwizard logback async log rotation causing application threads to wait
body: <p>The application threads get stuck whenever the log file rotates, this causes spike in latency of the API 
  I'm using an Async Appender, not sure why during rotation the application threads are waiting.</p>
  
  <p>logback.xml</p>
  
  <pre><code>&lt;configuration debug="true"&gt;
  &lt;property name="async.discardingThreshold" value="0"/&gt;
  &lt;property name="async.queueSize" value="500"/&gt;
  &lt;property name="log.dir" value="/var/log"/&gt;
  &lt;property name="log.pattern" value="%highlight(%-5level) [%date] [%thread] [%X{id}] [%cyan(%logger{0})]: %message%n"/&gt;
  &lt;property name="errorLog.pattern" value="%highlight(%-5level) [%date] [%thread] [%X{id}] [%red(%logger{0})]: %message%n"/&gt;
  &lt;property name="log.maxHistory" value="200"/&gt;
  &lt;property name="log.default.maxFileSize" value="100MB"/&gt;
  &lt;property name="log.error.maxFileSize" value="10MB"/&gt;
  
  
  &lt;appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;File&gt;${log.dir}/default.log&lt;/File&gt;
      &lt;Append&gt;true&lt;/Append&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
          &lt;fileNamePattern&gt;${log.dir}/default.%i.log.gz&lt;/fileNamePattern&gt;
          &lt;maxIndex&gt;${log.maxHistory}&lt;/maxIndex&gt;
      &lt;/rollingPolicy&gt;
      &lt;triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"&gt;
          &lt;maxFileSize&gt;${log.default.maxFileSize}&lt;/maxFileSize&gt;
      &lt;/triggeringPolicy&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%replace(${log.pattern}){'"pin":"\d+"','"pin":"XXXX"'}%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  
  &lt;appender name="ASYNC-INFO" class="ch.qos.logback.classic.AsyncAppender"&gt;
      &lt;discardingThreshold&gt;${async.discardingThreshold}&lt;/discardingThreshold&gt;
      &lt;queueSize&gt;${async.queueSize}&lt;/queueSize&gt;
      &lt;filter class="ch.qos.logback.core.filter.EvaluatorFilter"&gt;
          &lt;OnMismatch&gt;DENY&lt;/OnMismatch&gt;
          &lt;OnMatch&gt;NEUTRAL&lt;/OnMatch&gt;
      &lt;/filter&gt;
      &lt;appender-ref ref="INFO"/&gt;
  &lt;/appender&gt;
  
  &lt;appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;file&gt;${log.dir}/error.log&lt;/file&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
          &lt;fileNamePattern&gt;${log.dir}/error.%i.log.gz&lt;/fileNamePattern&gt;
          &lt;maxIndex&gt;${log.maxHistory}&lt;/maxIndex&gt;
      &lt;/rollingPolicy&gt;
      &lt;triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"&gt;
          &lt;maxFileSize&gt;${log.error.maxFileSize}&lt;/maxFileSize&gt;
      &lt;/triggeringPolicy&gt;
      &lt;encoder&gt;
          &lt;pattern&gt;%replace(${errorLog.pattern}){'"pin":"\d+"','"pin":"XXXX"'}%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  
  &lt;appender name="ASYNC-ERROR" class="ch.qos.logback.classic.AsyncAppender"&gt;
      &lt;discardingThreshold&gt;${async.discardingThreshold}&lt;/discardingThreshold&gt;
      &lt;queueSize&gt;${async.queueSize}&lt;/queueSize&gt;
      &lt;filter class="ch.qos.logback.classic.filter.ThresholdFilter"&gt;
          &lt;level&gt;ERROR&lt;/level&gt;
      &lt;/filter&gt;
  
      &lt;appender-ref ref="ERROR"/&gt;
  &lt;/appender&gt;
  
  
  &lt;root level="INFO"&gt;
      &lt;appender-ref ref="ASYNC-ERROR"/&gt;
      &lt;appender-ref ref="ASYNC-INFO"/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p></p>