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

Another bad priority in Syslog messages

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Layouts

      Description

      The method org.apache.logging.log4j.core.net.Priority#getValue() has the same problem as previously mentioned in issue LOG4J2-102:

      Incorrect:

      public int getValue() {
              return facility.getCode() << 3 + severity.getCode();
          }
      

      Correct:

      public int getValue() {
              return (facility.getCode() << 3) + severity.getCode();
          }
      

      Perhaps also clean up the code so that the logic is only implemented in one place:

          public static int getPriority(final Facility facility, final Level level) {
              return new Priority(facility, Severity.getSeverity(level)).getValue();
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pdjohe Paul D Johe
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified