docker compose日志不适用于syslog选项 [英] docker compose logging is not working with syslog option

查看:937
本文介绍了docker compose日志不适用于syslog选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像这样的docker-compose配置:

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}}"

当我将其部署到数字海洋时,我可以像这样成功地运行docker-compose up命令:

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

似乎已经正确配置了"syslog"以使其能够运行docker-compose,但是也许"syslog"驱动程序不可用?

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

我可以找到有关将syslog与docker结合使用的所有说明,均参考docker run命令,但是如何使syslog与docker-compose一起使用?

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?

推荐答案

这确实有效.我错误地配置了纸轨详细信息,所以我看不到日志.

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

这篇关于docker compose日志不适用于syslog选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆