Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1801

Add more detail to WARN Ignoring log event after log4j was shut down

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.9.0
    • Component/s: Core
    • Labels:
      None

      Description

      Currently, AsyncLoggerConfigDisruptor::enqueueEvent, AsyncLoggerDisruptor::tryPublish and AsyncLoggerDisruptor::enqueueLogMessageInfo catch exceptions when logging occurs after the context has been stopped.

      These errors are currently handled by logging to the status logger:

      LOGGER.warn("Ignoring log event after log4j was shut down.", contextName);
      

      This can be improved by adding more details from the LogEvent that is being dropped:

      LOGGER.warn("Ignoring log event after log4j was shut down: {} [{}] {}", event.getLevel(),
                 event.getLoggerName(), event.getMessage().getFormattedMessage()
                          + (event.getThrown() == null ? "" : Throwables.toStringList(event.getThrown())));
      

        Attachments

          Activity

            People

            • Assignee:
              remkop@yahoo.com Remko Popma
              Reporter:
              remkop@yahoo.com Remko Popma
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: