DEV Community

Michael Salaverry
Michael Salaverry

Posted on

How to send syslog logs from docker containers to a nearby Synology NAS

Using this docker compose yaml:

version: '3.9'
services:
  log-generator-syslog:
    image: mingrammer/flog
    command: flog -f rfc3164 -n 10
    logging:
      driver: syslog
      options:
        syslog-address: "udp://nas.local:514"
        syslog-format: rfc3164
        env: dev
        labels: tlv,michael-laptop
        tag: "{{.Name}}-{{.ID}}"
Enter fullscreen mode Exit fullscreen mode

We can generate fake logs using https://hub.docker.com/r/mingrammer/flog in the BSD syslog format. These logs are sent via UDP to the NAS in the same network

On the receiving NAS end, open the Log Center, and setup an endpoint for the container to write to.

config on synology nas for syslog

Then, just run the docker compose file with docker compose up and you should see your fake logs in synology! These logs can be searched and filtered

fake logs

Top comments (0)