Repository: logging-log4j2
Updated Branches:
  refs/heads/master 7c53af7ce -> 226f4348f


[LOG4J2-971] Another bad priority in Syslog messages.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/226f4348
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/226f4348
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/226f4348

Branch: refs/heads/master
Commit: 226f4348f42bf32890377c6a68c9b1151bd0bff0
Parents: 7c53af7
Author: Gary Gregory <[email protected]>
Authored: Wed Mar 4 11:21:18 2015 -0800
Committer: Gary Gregory <[email protected]>
Committed: Wed Mar 4 11:21:18 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/core/net/Priority.java     | 8 ++++++--
 src/changes/changes.xml                                      | 3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/226f4348/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
----------------------------------------------------------------------
diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
index 979c22e..159721b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Priority.java
@@ -43,9 +43,13 @@ public class Priority {
      * @return The integer value of the priority.
      */
     public static int getPriority(final Facility facility, final Level level) {
-        return (facility.getCode() << 3) + 
Severity.getSeverity(level).getCode();
+        return toPriority(facility, Severity.getSeverity(level));
     }
 
+    private static int toPriority(Facility aFacility, Severity aSeverity) {
+        return (aFacility.getCode() << 3) + aSeverity.getCode();        
+    }
+    
     /**
      * Returns the Facility.
      * @return the Facility.
@@ -67,7 +71,7 @@ public class Priority {
      * @return the value of this Priority.
      */
     public int getValue() {
-        return facility.getCode() << 3 + severity.getCode();
+        return toPriority(facility, severity);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/226f4348/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 665e236..d132420 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -39,6 +39,9 @@
       <action issue="LOG4J2-967" dev="ggregory" type="fix" due-to="Stefan 
Wehner">
         log4j2.component.properties not read for all properties.
       </action>
+      <action issue="LOG4J2-971" dev="ggregory" type="fix" due-to="Paul D 
Johe">
+        Another bad priority in Syslog messages.
+      </action>
     </release>
     <release version="2.2" date="2015-02-22" description="GA Release 2.2">
       <action issue="LOG4J2-938" dev="rpopma" type="fix" due-to="Mauro 
Molinari">

Reply via email to