Open alexvassel opened 8 years ago
@alexvassel example code: server.SetFormat(syslog.RFC5424) change into : server.SetFormat(syslog.Automatic)
Thanks.
Same problem.
I already tried this.
Same issue here, I'm piping messages trough logger and when using with default rsyslog messages are here when shut it down and start go-syslog default example nothing happens.
Any advice on this?
I'm pretty sure this worked once upon a time. You might try the example and with commit a2d3207f555818ade80551bf37e079b350db26c7 which was when my automatic parsing stuff got merged, I think. Then bisect.
Ok, update it's working but it's kinda VERY strict on RFC
Got the latest logger from utils-linux and works flawlessly now and logs everything I throw at it.
@abligh the current stable version is just fine seems the problem was the msg compliance with the RFC's
So advice for everyone else double check what format your app produces!
The autodetect stuff I wrote is quite strict on RFCs because if people don't follow the RFCs, it's ambiguous which decoder it should use. It can then pick the wrong decoder, which in turn drops the packet in its entirety later on in the decode. This can be resolved by explicitly setting the format, as the decoders themselves are more lax. I seem to recall one case where the only way to reserve early ambiguity is to look at something strange in the time format.
If it's so strict with RFCs that even when a format is explicitly selected it fails and the source is a well known application (e.g. rsyslog) then arguably that's a bug, and should be fixed.
@abligh don't think it's a bug, in my particular case the problem was in outdated seemingly logger, now it had no problem sending logs to rsyslog but messages were just not showing in go-syslog example server.
Once i got it upgraded to the latest version which have support for different RFC's and by default outputs RFC5424 compliant messages the issue went away this makes me think that logger had a bit flaky protocol and seems rsyslog has a bit more relaxed view on how the RFC's should be implemented.
As for your modifications before logger update neither explicit RFC selection or Automatic mode were of any help. After upgrading logger it works in either mode :)
@bgv I am also facing the same issue, logger messages which is not visible in Server side. What changes u made??, what you mean by utils-linux?
Hi. Running your example server.
When I try to log something from other go code or python script, I get empty log message like
map[hostname: tag: content: facility:0 severity:0 client:127.0.0.1:60172 tls_peer: timestamp:0001-01-01 00:00:00 +0000 UTC priority:0]
Python script is very simple
Simple as Go one
Did I forget something?
Thanks in advance.