docker compose logging is not working with syslog option

浪尽此生 提交于 2019-12-11 10:57:25

问题


I have a docker-compose configuration like this:

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 digital ocean & 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 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?


回答1:


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



来源:https://stackoverflow.com/questions/53422818/docker-compose-logging-is-not-working-with-syslog-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!