[systemd-devel] sd-daemon documentation vs syslog log levels and facilities
fullung at gmail.com
Thu Sep 1 09:17:01 PDT 2011
We started using systemd's logging today, but the documentation
tripped us up a bit and could perhaps be improved to help other users.
The example in the sd-daemon manual page makes no mention of facilities.
Thus we assumed that our logs would have the facility we configured in
SyslogFacility of our .service and logged our messages with only a
level, like in the example:
fprintf(stderr, SD_NOTICE "Hello World!\n");
After lots of stracing, we finally discovered that if you do this,
systemd uses the LOG_USER facility, instead of the one we configured
in our .service file.
Only once we had the full facility and log level in our prints did it
behave as we had expected.
The sd-daemon manual page should probably mention this, and maybe
systemd could use the configured SyslogFacility if it detects that
messages are being logged without a facility.
More information about the systemd-devel