Search code examples
loggingcluster-computingamazon-ecsaws-fargate

How to check logs inside ECS Fargate container?


I'm running a springboot application in a ECS fargate cluster. Is there any way I can log into Fargate docker container to see the logs?


Solution

  • The best way to check your container logs is by flagging the checkbox to send them to CloudWatch (this can be done at the container level configuration in the task definition): enter image description here

    Alternatively, if your log is in a specific file and not printed to stdout you can use ECS exec to get a shell inside the container and do your analysis from within.