Simple syslog setup for Docker

There are a lot of complex posts about logging from Docker containers – but there is a much simpler way.

On Linux, your syslog daemon, be it rsyslog, syslog-ng or the original bsd syslog, accepts messages via the /dev/log socket file.

If you want your app running inside your container to deliver log messages to the syslog daemon running on your host, just share /dev/log as a volume:

docker run -v /dev/log:/dev/log

And all messages sent to syslog inside your container will be sent to your main syslog daemon.

Leave a Comment