-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tagging log messages #6
Comments
that sounds reasonable to me! happy to merge a PR |
dra27
added a commit
to dra27/logs-syslog
that referenced
this issue
Aug 14, 2018
hannesm
added a commit
to hannesm/opam-repository
that referenced
this issue
Oct 27, 2018
CHANGES: - support for syslog-message.1.0.0 it split the `message` field of Syslog_message.t into `tag` and `content` use the name of Logs.src as tag when sending messages - move build system to dune (hannesm/logs-syslog#10 by @dra27) - provide Logs_syslog.facility Logs.Tag.def to specify facility in log message, add ?facility as default facility to all reporters (reported in hannesm/logs-syslog#7, fixed in hannesm/logs-syslog#9 by @dra27) - append ':' to source (reported in hannesm/logs-syslog#6, fixed in hannesm/logs-syslog#8 by @dra27) - add missing dependency on unix for logs-syslog.unix (hannesm/logs-syslog#4 by @dra27)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is related to verbosemode/syslog-message#18. While working on #5, I got caught in some of the evil which is systemd's journal.
On my (FWIW CentOS 7) box, UDP/TCP reporting was giving entries like:
You can see here
Logs
's default source of"application"
. According to RFC 3164, the space afterapplication
is sufficient to delimit it, but this is what happened when I switched to Unix domain sockets writing to/dev/log
:As far as I can understand, what's happening is that because the message doesn't look like a syslog message (for two reasons), journald determines that its destined for it instead and so you get the unwanted
ocamldefang journal:
prefix (i.e. neither the hostname nor the tag of the actual message have been interpreted). It's not clear whether rsyslogd rejected it or whether journald didn't forward it, but I think this is journald at fault, since it owns the socket. It was at this point that I discovered that when sending on local sockets, the hostname is supposed to be omitted (that is in rsyslogd's documentation, and I expect in other implementations of syslogd?). But this still didn't work:The issue seems to be the lack of the usual colon after
application
. If I change the log source to beapplication:
, then I get the entry expected:Note, for completeness, that if the hostname is sent, but the colon is added then you still get the
journal:
addition:Which leads finally to the feature request - would it seem reasonable to have this library append a
:
to the log source if it doesn't end with a non-alphanumeric character?The text was updated successfully, but these errors were encountered: