You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/03/04 17:41:04 UTC
[jira] [Commented] (LOG4J2-971) Another bad priority in Syslog
messages
[ https://issues.apache.org/jira/browse/LOG4J2-971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14347106#comment-14347106 ]
Gary Gregory commented on LOG4J2-971:
-------------------------------------
Thank you for the report.
Could you please provide a patch, preferably with a unit test.
> 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
> 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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org