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

Priority of the Event is not calculated correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: 2.11.1
    • Fix Version/s: None
    • Component/s: API, Layouts
    • Labels:
      None
    • Environment:

      RedHat 7.6

      OpenJDK 11

    • Flags:
      Important

      Description

      We are having a problem with the Priority of the event created by the log4j2 API.

      • According to the RFC 5424 specification, the priority is calculated as:
           PRIORITY = ( FACILITY x 8) + SEVERITY
      • In our configuration file (CSFLogConfigData.xml attached) we set the Facility = LOCAL7 (value = 23) and several Custom Levels:

      <CustomLevels>
      }}{{    <CustomLevel name="EMERGENCY" intLevel="2" />
      }}{{    <CustomLevel name="ALERT" intLevel="3" />
      }}{{    <CustomLevel name="CRITICAL" intLevel="4" />
      }}{{    <CustomLevel name="ERROR" intLevel="5" />
      }}{{    <CustomLevel name="WARNING" intLevel="6" />
      }}{{     <CustomLevel name="NOTICE" intLevel="7" />
      }}{{    <CustomLevel name="INFORMAL" intLevel="8" />
      }}{{    <CustomLevel name="DEBUG" intLevel="9" />
      </CustomLevels>

      • In our testing, we are provoking an Emergency Level event, as you can see in the screenshot attached (02-logEvent_customLevel)
      • The priority expected in the event after log4j2 management should be
            PRIORITY = (23 x 8) + 2 = 186
      • But in the TCP Stream, all the events have PRIORITY = 184 (screenshot attached 03-TCPStream_All184Values). In the screenshot the priority of some events can be seen, all of them with PRIORITY = 184, no matter the Severity Level of the event.

      We are seeing the Severity is not being added when calculating the priority. We have test with another facility, and the multiplication is ok, but in every case the Severity is not added.

       

      Is this a known problem?

      There is something wrong with our configuration?

        Attachments

        1. 03-TCPStream_All184Values.jpg
          181 kB
          Jose Luis
        2. CSFLogConfigData.xml
          2 kB
          Jose Luis
        3. 02-logEvent_customLevel.jpg
          21 kB
          Jose Luis

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              JLSG-Deimos Jose Luis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: