简体   繁体   English

ECS awslogs 如何工作

[英]how ECS awslogs works

I'm curious how it works using awslogs driver.我很好奇它是如何使用 awslogs 驱动程序工作的。 At Enabling the awslogs Log Driver for Your Containers section, it only mentioned setup logConfiguration using logDriver: awslogs.为您的容器启用 awslogs 日志驱动程序部分,它只提到使用 logDriver 设置 logConfiguration:awslogs。 It indeed works out of box, but when you check the Docker Daemon on the box Docker is not using awslogs driver.它确实是开箱即用的,但是当您检查盒子上的 Docker 守护程序时,Docker 没有使用 awslogs 驱动程序。 So, how it works?那么,它是如何工作的?

$ docker info | grep "Logging"
Logging Driver: json-file

One possibility is that it is being passed as an argument to the run command for each instance of the container .一种可能性是它作为参数传递给容器的每个实例的运行命令 I have the opposite issue -- and am finding it difficult to override a request to build a container from docker-machine that is passing in json-file as the log driver.我有相反的问题 - 我发现很难覆盖从 docker-machine 构建容器的请求,该请求将json-file作为日志驱动程序传递。

To verify this, you can use docker inspect on a given container.要验证这一点,您可以在给定的容器上使用docker inspect It will have a field for log driver that will indicate what log driver it was started with.它将有一个log driver字段,该字段将指示它启动时使用的日志驱动程序。 The docker info command you are using just tells you the default for the docker service.您正在使用的docker info命令只是告诉您 docker 服务的默认值。

However, if you do the docker inspect and it also says json-file , then there's probably something pulling the logs off the disk and into cloudwatch.但是,如果您执行 docker inspect 并且它也显示json-file ,那么可能有一些东西将日志从磁盘上拉到了 cloudwatch 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM