Log4j 2
  1. Log4j 2
  2. LOG4J2-268

Berkeley (persistent) agent for FlumeAppender only works with MapMessages (and thus not slf4j)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta7
    • Component/s: Flume Appender
    • Labels:
      None

      Description

      If I try and use the persistent FlumeAppender with slf4j then I get a NullPointerException in FlumePersistentManager.send because there is no GUID header.

      (My repro here was using a copy of Flume modified to use log4j2 - while this particular repro is exotic I'm confident that the general case detailed above will be very common).

      There is no GUID header because the FlumeEvent constructor only creates one if the message is a MapMessage.

      If the user is using slf4j then all messages are PersistentMessages - and thus will cause this logging to fail.

      The GUID is required because it's used as a key in the BerkeleyDB storage.

      My attempts at a simple fix ran afoul of the key lookup from the headers in FlumePersisentManager.WriterThread.run().

        Activity

        Hide
        Edward Sargisson added a comment -

        Works for me.

        Thanks for the quick turnaround.

        Show
        Edward Sargisson added a comment - Works for me. Thanks for the quick turnaround.
        Hide
        Ralph Goers added a comment -

        Fixed in revision 1487518. Please verify and close.

        Show
        Ralph Goers added a comment - Fixed in revision 1487518. Please verify and close.

          People

          • Assignee:
            Unassigned
            Reporter:
            Edward Sargisson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development