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

SmtpManager sends emails with OFF level messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.14.1
    • 2.15.0
    • Appenders
    • None

    Description

      I occasionally receive emails with logs that have OFF level and no message when using <SMTP> with a filter and the setting -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector.

      I believe the cause is that AsyncLoggerContextSelector uses RingBufferLogEvents, and when the filter matches these events are buffered by the SmtpManager and then cleared soon after by the RingBufferLogEventHandler. Once the SmtpManager's buffer has filled, the empty events are added to the email.

      There is logic in SmtpManager.add(LogEvent) to copy the contents of mutable messages, and it might be appropriate to do the same for RingBufferLogEvents.

      Attachments

        Issue Links

          Activity

            People

              vy Volkan Yazici
              barrynfleming Barry Fleming
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: