Software/systemd/syslog

Writing syslog Daemons Which Cooperate Nicely With systemd

THIS IS OUT OF DATE, PLEASE TAKE WITH A GRAIN OF SALT

Here are a few notes on things to keep in mind when you work on a syslog daemon for Linux, to ensure that your syslog daemon works nicely together with systemd. If your syslog implementation does not follow these rules, then it will not be compatible with systemd v35 and newer.

First, let's start with a few logging features that systemd provides you with that are otherwise unavailable. Besides the fact that many distributions rely on systemd these days this list should give you a hint what you gain in the logging area by using systemd:

And here are the recommendations:

Here are a few other recommendations, that are not directly related to systemd:

Current rsyslog implements all these recommendations. Other syslog implementations implement them at least partially.

The unit file you install for your service should look something like this:

[Unit]
Description=System Logging Service

[Service]
ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service
ExecStart=/sbin/rsyslogd -n
Sockets=syslog.socket
StandardOutput=null

[Install]
WantedBy=multi-user.target

And remember: don't ship any socket unit for /dev/log! That's already shipped along with systemd for you.