AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)

Instance Logs

The EC2 instances in your Elastic Beanstalk environment generate logs that you can view to troubleshoot issues with your application or configuration files. Logs created by the web server, application server, Elastic Beanstalk platform scripts, and AWS CloudFormation are stored locally on individual instances, and can be easily retrieved with the environment management console or EB CLI.

Tail logs are the last 100 lines of the most commonly used log files – Elastic Beanstalk operational logs and logs from the web server and/or application server. When you request tail logs in the environment management console or with eb logs, an instance in your environment concatenates the most recent log entries into a single text file and uploads it to Amazon S3

Bundle logs are full logs for a wider range of log files, including logs from yum and cron and several logs from AWS CloudFormation. When you request bundle logs, an instance in your environment packages the full log files into a ZIP archive and uploads it to Amazon S3.


Elastic Beanstalk Windows Server platforms do not support bundle logs.

To retrieve logs in the environment management console, navigate to Logs, choose Request Logs, and then choose the type of logs to retrieve. To get tail logs, choose Last 100 Lines. To get bundle logs, choose Full Logs

When Elastic Beanstalk finishes retrieving your logs, choose Download.

Tail and bundle logs are removed from Amazon S3 15 minutes after they are created. To persist logs, you can configure your environment to publish logs to Amazon S3 automatically after they have been rotated.

To enable log rotation to Amazon S3, navigate to the Software Configuration section of the Configuration page in the environment management console. Under Log Options, select Enable log file rotation to Amazon S3 and then choose Apply. Instances in your environment will attempt to upload logs that have been rotated once per hour.

To upload rotated logs to Amazon S3, the instances in your environment must have an instance profile with permission to write to your Elastic Beanstalk Amazon S3 bucket. These permissions are included in the default instance profile that Elastic Beanstalk prompts you to create when you create an environment in the Elastic Beanstalk console or by using the EB CLI.

Environments in Frankfurt (eu-central-1) require Amazon S3 permissions for tail and bundle logs in addition to log rotation. Environments in other regions only require permissions for log rotation and can process tail and bundle logs without them.

If your application generates logs in a location that is not part of the default configuration for your environment's platform, you can extend the default configuration with configuration files (.ebextensions). You can add your application's log files to tail logs, bundle logs, or log rotation.

Log Location on-Instance

Logs are stored in standard locations on the EC2 instances in your environment. Elastic Beanstalk generates the following logs:


  • /var/log/eb-activity.log

  • /var/log/eb-commandprocessor.log

  • /var/log/eb-version-deployment.log

Windows Server

  • C:\Program Files\Amazon\Elastic Beanstalk\logs\

These logs contain messages about deployment activities including messages related to configuration files (.ebextensions).

Each application and web server stores logs in its own folder:

  • Apache/var/log/httpd/

  • IISC:\inetpub\wwwroot\

  • Node.js/var/log/nodejs/

  • nginx/var/log/nginx/

  • Passenger/var/app/support/logs/

  • Puma/var/log/puma/

  • Python/opt/python/log/

  • Tomcat/var/log/tomcat8/

Log Location in S3

When you request tail or bundle logs from your environment, or instances upload rotated logs, they are stored in your Elastic Beanstalk bucket in Amazon S3. Elastic Beanstalk creates a bucket named elasticbeanstalk-region-account-id for each region in which you create environments. Within this bucket, logs are stored under the path resources/environments/logs/logtype/environment-id/instance-id.

For example, logs from instance i-0a1fd158, in Elastic Beanstalk environment e-mpcwnwheky in region us-west-2 in account 0123456789012, are stored in the following locations:

  • Tail Logs


  • Bundle Logs


  • Rotated Logs



You can find your environment ID in the environment management console.

Elastic Beanstalk deletes tail and bundle logs from Amazon S3 automatically 15 minutes after they are created. Rotated logs persist until you delete them or move them to Amazon Glacier.

Extending the Default Log Configuration

Elastic Beanstalk uses files in subfolders of /opt/elasticbeanstalk/tasks on the EC2 instance to configure tasks for tail logs, bundle logs and log rotation.

  • Tail Logs


  • Bundle Logs


  • Rotated Logs


For example, the file eb-activity.conf adds two logs files to the tail logs task:



You can add .conf files to these folder with configuration files (.ebextensions) to add log files specific to your application to those tasks.

Use the files key to add configuration files to the tasks that you want to modify. For example, the following configuration file adds a config to each instance in your environment that adds /var/log/cloud-init.log to tail logs:

  "/opt/elasticbeanstalk/tasks/taillogs.d/cloud-init.conf" :
    mode: "000755"
    owner: root
    group: root
    content: |

Add this text to a file with the .config extension to your source bundle under a folder named .ebextensions:

|-- .ebextensions
|   `-- tail-logs.config
|-- index.php
`-- styles.css

You can also use wildcards in log task configurations. This configuration file adds all files with the .log extension from the log folder in the application root to bundle logs:

  "/opt/elasticbeanstalk/tasks/bundlelogs.d/applogs.conf" :
    mode: "000755"
    owner: root
    group: root
    content: |

For more information on using configuration files, see Advanced Environment Customization with Configuration Files (.ebextensions).