Logs to AWS Cloudwatch from Docker Containers Logs to AWS Cloudwatch from Docker Containers docker docker

Logs to AWS Cloudwatch from Docker Containers


The awslogs works without using ECS.

you need to configure the AWS credentials (the user should have IAM roles appropriate [cloudwatch logs]).

I used this tutorial, it worked for me: https://wdullaer.com/blog/2016/02/28/pass-credentials-to-the-awslogs-docker-logging-driver-on-ubuntu/


I was getting the same error but when I checked the cloudwatch logs, I was able to see the logs in cloudwatch. Did you check that if you have the logs group created in cloudwatch. Docker doesn't support console logging when we use the custom logging drivers.

The section on limitations here says that docker logs command is only available for json-file and journald drivers, and that's true for built-in drivers.

When trying to get logs from a driver that doesn't support reading, nothing hangs for me, docker logs prints this:

Error response from daemon: configured logging driver does not support reading


There are 3 main steps involved it to it.

  1. Create an IAM role/User
  2. Install CloudAgent
  3. Modify docker-compose file or docker run command

I have referred an article here with steps to send the docker logs to aws cloudwatch.