title: log4j RollingFileAppender performance
body: <p>I need to log heavily for further analysis so when file is rolled the whole flow stuck for a while doing something like this:  </p>
  
  <pre><code>"org.springframework.kafka.KafkaListenerEndpointContainer#1-1-C-1" - Thread t@56
     java.lang.Thread.State: BLOCKED
      at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.checkRollover(RollingFileManager.java:174)
      - waiting to lock &lt;2afdff68&gt; (a org.apache.logging.log4j.core.appender.rolling.RollingFileManager) owned by "SrpResultsProcessor-8" t@90
      at org.apache.logging.log4j.core.appender.RollingFileAppender.append(RollingFileAppender.java:280)
      at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
      at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:447)
      at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:432)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:416)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:402)
      at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
      at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
      at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2091)
      at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2005)
      at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1876)
      at org.apache.logging.slf4j.Log4jLogger.debug(Log4jLogger.java:124)
  ...    
  </code></pre>
  
  <p>Here is my yaml config:  </p>
  
  <pre><code>Configuration:
  name: default
  
  Appenders:
  
    RollingFile:
      - name: stdout
        fileName: ../logs/${component.name}.log
        filePattern: "../logs/archive/${component.name}_%d{yyyy-MM-dd}_%i.log.zip"
        PatternLayout:
          pattern: "%d{ISO8601} %-5level [%t] %logger{36} - %msg%n"
        Policies:
          SizeBasedTriggeringPolicy:
            size: 300 MB
        DefaultRollOverStrategy:
          max: 20
          Delete:
            basePath: ../logs
            maxDepth: 2
            IfFileName:
              glob: "*/${component.name}_*.log.zip"
              IfAccumulatedFileCount:
                exceeds: 50
  
      - name: stderr
        fileName: ../logs/${component.name}.err
        filePattern: "../logs/archive/${component.name}_%d{yyyy-MM-dd}_%i.err.zip"
        PatternLayout:
          pattern: "%d{ISO8601} %-5level [%t] %logger{36} - %msg%n"
        Policies:
          SizeBasedTriggeringPolicy:
            size: 300 MB
        DefaultRollOverStrategy:
          max: 5
          Delete:
            basePath: ../logs
            maxDepth: 2
            IfFileName:
              glob: "*/${component.name}_*.err.zip"
              IfAccumulatedFileCount:
                exceeds: 10
  ...
  </code></pre>
  
  <p>Any ideas to improve performance of the 'rolling'?</p>