title: How to handle exceptions in logging when use Log4j2 Async logging?
body: <p>In my application, I am using <code>Log4j2</code> in Async mode (Async logger using <code>Disruptor</code>), can some one pls tell me how to handle an exception that happens in the logging process. Logging is very critical for my application, I don't want to miss a single log statement. If something goes wrong with logging, that needs to be alerted immediately.</p>
  
  <p>As per Apache <a href="https://logging.apache.org/log4j/2.x/manual/async.html" rel="nofollow">Log4j page</a>, suggests to use <code>ExceptionHandler</code>, but I couldn't find a helping topic on how to use this. </p>
  
  <blockquote>
    <p>Error handling. If a problem happens during the logging process and an
    exception is thrown, it is less easy for an asynchronous logger or
    appender to signal this problem to the application. This can partly be
    alleviated by configuring an <code>ExceptionHandler</code>, but this may still not
    cover all cases. For this reason, if logging is part of your business
    logic, for example if you are using Log4j as an audit logging
    framework, we would recommend to synchronously log those audit
    messages. (Note that you can still combine them and use asynchronous
    logging for debug/trace logging in addition to synchronous logging for
    the audit trail.)</p>
  </blockquote>
  
  <p>Waiting for suggestions.</p>