Log4j 2
  1. Log4j 2
  2. LOG4J2-404

"@EnterpriseNumber" is missing in the ID of structured data when RFC5424Layout is used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: None
    • Component/s: Layouts
    • Labels:
      None

      Description

      Prior to beta9, when RFC5424 layout was used, the ID hasd the format "id@ein". With beta9, "@ein" is missing. Example

      Prior to beta9:

      <128>1 2013-09-16T02:07:24.027-07:00 myhost.com MyTestApp - Audit [stopPayment@12293 accountNumber="REPLACE" amount="***" checkNumber="***" comment="Changed mind" endSequence="4322" errorMessage="None" guId="669317b1-1eaf-11e3-80ec-005056b5071b" issueDate="20110504"][RequestContext@12293 ReqCtx_sessionId="66927b70***" ReqCtx_timezone="America/Los_Angeles" ReqCtx_tzOffset="-0800" ReqCtx_userProduct="IB" ReqCtx_userProductVersion="4.18.1"]

      With beta9:

      <128>1 2013-09-16T02:07:24.027-07:00 myhost.com MyTestApp - Audit [stopPayment accountNumber="REPLACE" amount="***" checkNumber="***" comment="Changed mind" endSequence="4322" errorMessage="None" guId="669317b1-1eaf-11e3-80ec-005056b5071b" issueDate="20110504"][RequestContext@12293 ReqCtx_sessionId="66927b70***" ReqCtx_timezone="America/Los_Angeles" ReqCtx_tzOffset="-0800" ReqCtx_userProduct="IB" ReqCtx_userProductVersion="4.18.1"]

      "@12293" is missing after the ID (stopPayment).

        Activity

        Hide
        Kamal Bahadur added a comment -

        I see that the method private String getId(final StructuredDataId id) is not being called.

        Show
        Kamal Bahadur added a comment - I see that the method private String getId(final StructuredDataId id) is not being called.
        Hide
        Kamal Bahadur added a comment -

        Attached is the patch.

        Show
        Kamal Bahadur added a comment - Attached is the patch.
        Hide
        Kamal Bahadur added a comment -

        Is there anything I can do to get this patch committed? This is blocking our production release.

        Show
        Kamal Bahadur added a comment - Is there anything I can do to get this patch committed? This is blocking our production release.
        Hide
        Gary Gregory added a comment -

        Ralph, I think you did some work recently in these classes WRT to SD elements. Is this bug a side effect? Does the patch look OK to you? It sounds like a regression due to the lack of a unit test.

        Show
        Gary Gregory added a comment - Ralph, I think you did some work recently in these classes WRT to SD elements. Is this bug a side effect? Does the patch look OK to you? It sounds like a regression due to the lack of a unit test.
        Hide
        Ralph Goers added a comment -

        This is a side effect of LOG4J2-355 which you applied. Unfortunately, I have been very busy and didn't sufficiently review that patch. I did notice that the unit test was changed, which raised some concern but at first glance it looked like it might have been correcting a mistake. Now I am not so sure.

        Show
        Ralph Goers added a comment - This is a side effect of LOG4J2-355 which you applied. Unfortunately, I have been very busy and didn't sufficiently review that patch. I did notice that the unit test was changed, which raised some concern but at first glance it looked like it might have been correcting a mistake. Now I am not so sure.
        Hide
        Kamal Bahadur added a comment -

        Is this fix available in the snapshot?

        Show
        Kamal Bahadur added a comment - Is this fix available in the snapshot?
        Hide
        Gary Gregory added a comment -

        @Kamal, could you please provide another patch for a unit tests? See org.apache.logging.log4j.core.layout.RFC5424LayoutTest. (I am sick today).

        Show
        Gary Gregory added a comment - @Kamal, could you please provide another patch for a unit tests? See org.apache.logging.log4j.core.layout.RFC5424LayoutTest. (I am sick today).
        Hide
        Kamal Bahadur added a comment -

        This attached patch contains unit test that catches this bug.

        Show
        Kamal Bahadur added a comment - This attached patch contains unit test that catches this bug.
        Hide
        Ralph Goers added a comment -

        Both patches were applied in revision 1526807. Please verify and close.

        Show
        Ralph Goers added a comment - Both patches were applied in revision 1526807. Please verify and close.
        Hide
        Kamal Bahadur added a comment -

        This is working fine now.

        Show
        Kamal Bahadur added a comment - This is working fine now.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kamal Bahadur
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development