- Newest
- Most votes
- Most comments
I understand that when you are running a shell script as your Entrypoint in the Docker file. When deploying the image in ECS Fargate, you observed that the logs are no longer pushed to cloudwatch. As you might already know, The awslogs log driver simply passes the container logs that are the STDOUT and STDERR I/O streams from Docker to CloudWatch Logs. Now, I understand that you were able to see the logs when running the command directly instead of running as an “exec” in a shell script.
So, since you are running the container on ECS Fargate, you would not be able to access the underlying host where the task is running. Hence, I would suggest that you try launching the same container on EC2 launch type with the same Network configuration as your Fargate tasks. Doing this, once the task gets scheduled on an EC2 worker nodes, you can SSH in to the EC2 worker node and then check if “docker logs <container-name>” shows expected data in the output. Verifying that you are able to run the ECS Task on EC2 container instance would be the next step after verifying that your container runs fine in your local maching. When you run docker logs from within the worker node, you are essentially pulling the STDOUT/STDERR log streams captured from the container. If the docker logs command does not return any output then you can further troubleshoot the issue by trying to exec in to the container to see if the application is running in the container as expected and verify if the application is able to write logs out to the STDOUT.
Considering that we need additional information to be able to completely understand what the issue is, I would suggest that you raise a support ticket with AWS Premium Support to get assistance with this issue.
Relevant content
- asked 3 years ago
- Accepted Answerasked 10 months ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 months ago
In both scenarios, the container runs as expected and does it's job. Just the logging is missing from the docker-entrypoint run