Log4j 2
  1. Log4j 2
  2. LOG4J2-574

Make Blocking the default WaitStrategy for Async Loggers


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc1
    • Fix Version/s: 2.0-rc2
    • Component/s: Appenders
    • Labels:


      With Asynchronous Loggers, the wait strategy determines what the consumer thread does when the queue is empty and it is waiting for events. The LMAX Disruptor offers several options, as some specialized apps want to avoid the latency of waking up a blocked thread. These options have different trade-offs, with busy spin on one end of the spectrum and blocking on the other.

      In log4j we only expose a limited set of these options (no busy spin), and originally chose SleepingWait as the default as it seemed to have the best performance in testing.

      It turned out that in some environments the current default of SleepingWaitStrategy may result in excessive CPU usage (LOG4J2-571). To avoid such problems this ticket proposes to change the default wait strategy for Async Loggers to BlockingWaitStrategy.

        Issue Links


          Remko Popma created issue -
          Remko Popma made changes -
          Field Original Value New Value
          Link This issue is related to LOG4J2-571 [ LOG4J2-571 ]
          Remko Popma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Remko Popma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]


            • Assignee:
              Remko Popma
              Remko Popma
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: