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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8
    • 2.9.0
    • Core
    • 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

            rpopma Remko Popma
            rpopma Remko Popma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: