Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I capture the console output for a container launched on ECS?

When I launch a container using docker run the command prompt shows a lot of useful information that's invaluable while debugging.

Is there a mechanism is ECS that allows me to capture this information? At the moment, I'm SSH'ing into the container and launching containers manually to debug them, which is not ideal.

like image 558
Liam M Avatar asked Jan 18 '17 11:01

Liam M


2 Answers

Yep. You can use CloudWatch Logs in combination with ECS. It does require a bit more setup, but once done all container logs will be streamed into CloudWatch Logs which means it can be viewed from the AWS console.

General CloudWatch Log integration with ECS is explained here. Using the awslogs Driver as part of your task definitions is explained in more detail here.

Hope that helps.

like image 55
Rob Blake Avatar answered Nov 07 '22 15:11

Rob Blake


You can also use fluentd log driver.

For more details in here: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_storage

like image 35
minamijoyo Avatar answered Nov 07 '22 16:11

minamijoyo