docker-compose logging is not working with syslog option

dylanjha picture dylanjha · Nov 22, 2018 · Viewed 7.6k times · Source

I have the following docker-compose configuration:

version: '3'
services:
  worker:
    image: // image
    logging:
      driver: syslog
      options:
        syslog-address: "udp://XXX.papertrailapp.com:XXXX"
        tag: "{{.Name}}/{{.ID}}"

When I deploy this to DigitalOcean under Ubuntu, I can successfully run the docker-compose up command like so:

docker-compose -f docker-compose.yml up

When that command runs I can see this output:

worker_2_844fc7675414 | WARNING: no logs are available with the 'syslog' log driver
worker_1_5c91a3426046 | WARNING: no logs are available with the 'syslog' log driver

It appears that syslog is correctly configured for the docker-compose up command to run, but that perhaps the syslog driver is not available?

All the instructions I can find for using syslog with docker refer to docker run commands. But how can I get syslog working with docker-compose?

Answer

dylanjha picture dylanjha · Nov 25, 2018

This does in fact work. I erroneously had the papertrail details misconfigured so I was not seeing the logs.