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

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

问题描述

我有以下docker-compose配置:

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

在Ubuntu下将其部署到DigitalOcean时,我可以成功运行 docker-compose up 命令如下:

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

没有可用的日志看来为<$ c正确配置了syslog $ c> docker-compose up 命令运行,但是也许syslog驱动程序不可用?

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

我可以找到有关在docker上使用syslog的所有说明请参考 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天全站免登陆