问题
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