繁体   English   中英

有没有办法通过任务定义配置在 AWS ECS 中轮换日志?

[英]Is there a way to rotate logs in AWS ECS through task definition configuration?

我通过在 AWS ECS 中配置任务定义在 EC2 中运行数据狗代理容器。

但是此时/var/lib/docker/containers/ ContainerID / ContainerID .json 中存储了海量的日志,以至于我想轮流使用。

在Docker文档中,看到了这个链接

  "log-opts": {
    "max-size": "10m",
    "max-file": "3"

现在我想通过任务定义配置这些选项,但我不知道它们的约定。 有人有什么想法吗?

如果你放入 ECS 任务定义(示例来自 json 版本,但在 UI 中也可以设置),你应该能够配置容器日志:

"logConfiguration": {
   "logDriver": "json-file",
   "options": {
       "max-size": "10m",
       "max-file": "3"
   }
}

暂无
暂无

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

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