docker-compose logging is not working with syslog option
Asked Answered
H

1

6

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?

Harakiri answered 22/11, 2018 at 1:47 Comment(4)
I believe that message is simply telling you that you won't see any logs on your console because you have elected to send them to syslog instead. Have you actually checked to see if your logs are being successfully received at papertrail?Incorruptible
Since docker compose up is running in foreground, it will look for STDOUT logs of containers. You have changed the logging driver to syslog which means all the STDOUT of container will be sent to syslog. Use docker-compose -f docker-compose.yml up -d and look for logs in syslog.Merrileemerrili
@Incorruptible I did check papertrail! Unfortunately not seeing the logs there :(...Harakiri
@larsks, I had the papertrail details misconfigured! This is actually logging to papertrail, thank you!Harakiri
H
3

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

Harakiri answered 25/11, 2018 at 9:57 Comment(2)
…I erroneously had the papertrail details misconfigured…“ – @Harakiri — | Any chance you remember the details of what the correct configuration should be? Are you able to share that, please? TIA.Aretta
The syslog address I had was straight up the wrong oneHarakiri

© 2022 - 2024 — McMap. All rights reserved.