4

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?

jnovack
  • 7,629
  • 2
  • 26
  • 40
dylanjha
  • 2,303
  • 4
  • 28
  • 47
  • 2
    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? – larsks Nov 22 '18 at 04:32
  • 2
    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. – Raghwendra Singh Nov 22 '18 at 12:23
  • @larsks I did check papertrail! Unfortunately not seeing the logs there :(... – dylanjha Nov 25 '18 at 03:44
  • @larsks, I had the papertrail details misconfigured! This is actually logging to papertrail, thank you! – dylanjha Nov 25 '18 at 09:57

1 Answers1

1

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

dylanjha
  • 2,303
  • 4
  • 28
  • 47
  • 1
    „*…I erroneously had the papertrail details misconfigured…*“ – @dylanjha — | Any chance you remember the details of what the *correct* configuration *should* be? Are you able to share that, please? TIA. – deduper Sep 27 '20 at 13:57
  • The syslog address I had was straight up the wrong one – dylanjha Sep 28 '20 at 17:21