Closed mbodmer closed 2 years ago
Hi, could you please try out the version in branch syslog_rfc_3164
?
The SysLogWriter there has an additional factory method, try_new_bsd
, which should do what you need.
Hi "emabee", thank you so much for your work, and sorry for not coming back to this earlier. I have now tested your change and it is almost there. To take the same example as above I now get this:
May 3 10:46:15 myhostname myhostname target/debug/mybinary mylogmsg
...
May 3 10:46:17 myhostname ntpd[989]: Soliciting pool server x.x.x.x
I've again included the ntp log line for comparison.
So:
Thats all an thanks again. Grüsse aus der Schweiz, Marc
I have forked your repo and changed my requests above myself: https://github.com/mbodmer/flexi_logger/commit/f10f73c3edf812bf609d55ffeadae86d032e3cbb
I'm not sure however, how I could contribute this using gh. Should I open a PR, even when it's actually your branch?
Fixed with 0.22.4
I've created a Syslog Writer instance like this:
The resulting Syslog output looks like that:
As you can see, the sylog message produced by flexi_logger does not correspond to the other messages (eg. ntp as shown) on the system. I am not aware of other implementations, but on Linux (Ubuntu 20.04) the log messages are automatically prefixed with timestamp and hostname, when they don't have a timestamp and hostname (the format is probably not recognized here). see: https://datatracker.ietf.org/doc/html/rfc3164#section-4.2
I've just became aware of at least two syslog rfc:
How would I use SyslogWriter with a custom log format as a workaround. Since I'm new to rust this is not obvious to me, sorry.