diff --git a/README.md b/README.md index b76e95f..3529888 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Basic syslog server written in Java. All received messages are written to *stdou The syslog server is able to listen on UDP and/or TCP and parses syslog messages in either RFC5424 or RFC3164 (BSD) format. The default syslog port (514) requires you to run syslogd as root / administrator. If you do not with to do so, you can choose a port number (with the -p flag) above 1024. -*This project is in no way associated with, supported or endorsed by, International Business Machines Corporation (IBM).* - ## Usage Instructions - Install the syslogd package (*.deb* or *.rpm*) from [downloads](https://bitbucket.org/mnellemann/syslogd/downloads/) or compile from source. diff --git a/src/main/java/biz/nellemann/syslogd/SyslogParser.java b/src/main/java/biz/nellemann/syslogd/SyslogParser.java index cee9237..86843e9 100644 --- a/src/main/java/biz/nellemann/syslogd/SyslogParser.java +++ b/src/main/java/biz/nellemann/syslogd/SyslogParser.java @@ -137,9 +137,7 @@ public class SyslogParser { // Date: Mmm dd hh:mm:ss Instant instant = null; try { - DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy MMM dd HH:mm:ss") - .withLocale(Locale.getDefault()) - .withZone(ZoneId.systemDefault()); + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy MMM dd HH:mm:ss").withZone(ZoneOffset.UTC); instant = Instant.from(dateTimeFormatter.parse(odt.getYear() + " " + dateString)); } catch(DateTimeParseException e) { log.error("parseDate()", e); diff --git a/src/test/groovy/biz/nellemann/syslogd/SyslogParserTest.groovy b/src/test/groovy/biz/nellemann/syslogd/SyslogParserTest.groovy index 222e27d..d0d94a4 100644 --- a/src/test/groovy/biz/nellemann/syslogd/SyslogParserTest.groovy +++ b/src/test/groovy/biz/nellemann/syslogd/SyslogParserTest.groovy @@ -10,7 +10,7 @@ class SyslogParserTest extends Specification { setup: OffsetDateTime odt = OffsetDateTime.now() - String dateString = "Sep 12 22:50:13" + String dateString = "Sep 12 20:50:13" when: Instant inst = SyslogParser.parseRfc3164Timestamp(dateString)