void-linux/void-runit

man vlogger: incorrect documentation regarding the default tag and facility

jdbourbaki opened this issue · 1 comments

The vlogger (8) man page) says:

-p pri
The pri can be facility.level or just facility.
...
The default is user.notice.

And later:

-t tag

Defines the openlog 3 ident which is used as prefix for each log message or passed as first argument to /etc/vlogger.

The default is the LOGNAME environment variable.

The statements about the default facility and tag are incorrect. In particular, the default tag does not in any way depend on the LOGNAME environment variable.

The actual defaults are:

Facility: "notice" unless vlogger detects that it was exec'd as "./run" from within the directory "runsvdir/service/log" where "runsvdir" is an arbitrary path and "service" an arbitrary directory name -- in that case the default facility is "daemon".

tag: if vlogger detects that it was exec'd as "./run" from within the directory "runsvdir/service/log" where "runsvdir" is an arbitrary path and "service" an arbitrary directory name then the default tag is the name of the service directory. Otherwise, if vlogger is calling /etc/vlogger then the default tag is an empty string, while if vlogger is logging to a socket then the default tag is the current username as reported by getlogin().

Both the facility and tag differences for $SV/log/run are covered:

If vlogger is executed as a log service for runit(8) or another daemontools like supervision suite it uses the service name as default tag. As example if vlogger is linked to /var/service/foo/log/run it uses “foo” as tag and “daemon.notice” as pri.

I don't see vlogger.c using LOGNAME but @Duncaen will have better insight than me about that.