Reputation: 4538
I have a program that I'd like to run in Docker that outputs a dot every 3 seconds to stdout. Locally, if I run this I don't see the logs:
docker build . docker start
whereas if I do this, I see the logs:
docker build . docker start -t
Now, how would i get the logs when deploying to amazon fargate? I've tried a number of things but it seems stdout stream isn't being saved to the cloudwatch.
Upvotes: 1
Views: 5539
Reputation: 704
To get stdout logs in Cloudwatch you just need to specify the log driver in your ECS Task definition as awslogs.
Find more info here: https://docs.docker.com/config/containers/logging/awslogs/
and here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_cloudwatch_logs.html
Upvotes: 1