[ 
https://issues.apache.org/jira/browse/LOG4J2-971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul D Johe closed LOG4J2-971.
------------------------------

Verified! Thanks!

> 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
>              Labels: syslog, syslogappender
>             Fix For: 2.2.1
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> 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