Amazon Elastic Container Service
Developer Guide (API Version 2014-11-13)

Amazon ECS Logs Collector

If you are unsure how to collect all of the various logs on your container instances, you can use the Amazon ECS logs collector, which is available on GitHub. The script collects general operating system logs as well as Docker and Amazon ECS container agent logs, which can be helpful for troubleshooting AWS Support cases. It then compresses and archives the collected information into a single file that can easily be shared for diagnostic purposes. It also supports enabling debug mode for the Docker daemon and the Amazon ECS container agent on Amazon Linux variants, such as the Amazon ECS-optimized AMI. Currently, the Amazon ECS logs collector supports the following operating systems:

  • Amazon Linux

  • Red Hat Enterprise Linux 7

  • Debian 8


The source code for the Amazon ECS logs collector is available on GitHub. We encourage you to submit pull requests for changes that you would like to have included. However, Amazon Web Services does not currently support running modified copies of this software.

To download and run the Amazon ECS logs collector

  1. Connect to your container instance. For more information, see Connect to Your Container Instance.

  2. Download the Amazon ECS logs collector script.

    curl -O
  3. Run the script to collect the logs and create the archive.


    To enable debug mode for the Docker daemon and the Amazon ECS container agent, add the --mode=debug option to the command below. This may restart the Docker daemon, which kills all containers that are running on the instance. Consider draining the container instance and moving any important tasks to other container instances before enabling debug mode. For more information, see Container Instance Draining.

    [ec2-user ~]$ sudo bash ./

After you have run the script, you can examine the collected logs in the collect folder that the script created. The collect.tgz file is a compressed archive of all of the logs, which you can share with AWS Support for diagnostic help.