Paul D Johe created LOG4J2-971:
----------------------------------

             Summary: Another bad priority in Syslog messages
                 Key: LOG4J2-971
                 URL: https://issues.apache.org/jira/browse/LOG4J2-971
             Project: Log4j 2
          Issue Type: Bug
          Components: Layouts
    Affects Versions: 2.2
            Reporter: Paul D Johe


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

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

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

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

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to