DEV Community

Michael Salaverry
Michael Salaverry

Posted on

3

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay