mcuadros / go-syslog

Syslog server library for go.
http://godoc.org/gopkg.in/mcuadros/go-syslog.v2
MIT License
523 stars 143 forks source link

Fix GNU syslog #63

Closed boyska closed 5 years ago

boyska commented 5 years ago

The current implementation doesn't seem to work with GNU syslog()

I have especially tested its integration with systemd-journald, and I'm not getting messages from /run/systemd/journal/syslog correctly.

The error appears to be in the fact that GNU syslog() (and therefore, journald) omits the hostname from their messages.

My patch understands this case, and assumes it is a local message in that case.

I also added unit tests to ensure that both "normal" 3164 messages and GNU variant is working correctly.