Skip to content

Commit

Permalink
Merge pull request #24 from SpyrosPac/master
Browse files Browse the repository at this point in the history
Fix #23 Priority calculation for rfc3164
  • Loading branch information
Cyrille Le Clerc authored Jun 29, 2018
2 parents fed60cf + 700bf10 commit 79db90d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/cloudbees/syslog/SyslogMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public String toRfc3164SyslogMessage() {
*/
public void toRfc3164SyslogMessage(Writer out) throws IOException {

int pri = facility.numericalCode() + severity.numericalCode();
int pri = facility.numericalCode() * 8 + severity.numericalCode();

out.write('<');
out.write(Integer.toString(pri));
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/cloudbees/syslog/SyslogMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void testRfc3164Format() throws Exception {
.withMsg("a syslog message");

String actual = message.toRfc3164SyslogMessage();
String expected = "<7>Dec 05 10:30:05 myserver.example.com my_app: a syslog message";
String expected = "<14>Dec 05 10:30:05 myserver.example.com my_app: a syslog message";

assertThat(actual, is(expected));

Expand Down

0 comments on commit 79db90d

Please sign in to comment.