2回答
- 新しい順
- 投票が多い順
- コメントが多い順
1
Hi, Good question
I think you can use
put-retention-policy
--log-group-name <value>
--retention-in-days <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
https://docs.aws.amazon.com/cli/latest/reference/logs/put-retention-policy.html
0
Actually, you can create LogGroup yourself and attach it to the Task Definition like here if you are using CloudFormation.
Then in LogGroup, you can simply set retention and another benefit is that LogGroup will be removed together with CloudFormation stack.
回答済み 4年前

Thanks! So there is no way that I can set this policy from task definitions?
I think It can only be done through CloudWatch. Docker has the following options and I can't seem to find anything related to
retentionhttps://docs.docker.com/config/containers/logging/local/