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())));
      

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ab33665bf3eb542ef0dc751f9b44a59043003fb0 in logging-log4j2's branch refs/heads/master from rpopma
        [ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=ab33665 ]

        LOG4J2-1801 Add more detail to WARN "Ignoring log event" messages printed to the console after log4j was shut down.

        Show
        jira-bot ASF subversion and git services added a comment - Commit ab33665bf3eb542ef0dc751f9b44a59043003fb0 in logging-log4j2's branch refs/heads/master from rpopma [ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=ab33665 ] LOG4J2-1801 Add more detail to WARN "Ignoring log event" messages printed to the console after log4j was shut down.
        Hide
        remkop@yahoo.com Remko Popma added a comment -

        Pushed to master.

        Show
        remkop@yahoo.com Remko Popma added a comment - Pushed to master.

          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:

              Development