Bug 238345 - usr/bin/logger: Old syslog format when using remote host option (-h)
Summary: usr/bin/logger: Old syslog format when using remote host option (-h)
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2019-06-05 17:50 UTC by Niclas Zeising
Modified: 2020-04-06 18:10 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Niclas Zeising freebsd_committer 2019-06-05 17:50:12 UTC
About a year ago, syslogd(8) and subsequently syslog(3) grew the feature to handle rfc5424 syslog formats.  logger(1) is a small CLI interface to syslog(3), with which you can generate log messages to either log locally, or remotely.

When using logger without the -h option, it uses the syslog(3) libc interface to format and send a log message to the default place, usually a socket /var/run/log, on which syslogd(8) listens.  Since syslog(3) generates rfc5424 compliant messages, this will also be rfc5424 compliant.

When using logger with the -h option, to send logs to another machine, or another  local socket, logger(1) formats the message in a non-rfc5424 compliant manner.  This causes a lot of confusion, since the behavior is quite different depending on whether -h is used or not.

I would like to see that logger(8) grew the ability to generate rfc5424 messages in all cases, but I'm unsure about how to proceed.  One idea is to simply take the code from syslog(3) (really vsyslog1()) which generates rfc5424 compliant messages, and put that in logger(1).  Another idea is to make the rfc5424 message generator a function in either libc or another library, for both syslog(3) and logger(1) (and possibly others) to consume.  Which way is best?