AWS Elastic Beanstalk
Developer Guide

Viewing Your Elastic Beanstalk Environment Logs

AWS Elastic Beanstalk provides two ways to regularly view logs from the Amazon EC2 instances that run your application:

  • Configure your Elastic Beanstalk environment to upload rotated instance logs to the environment's Amazon S3 bucket.

  • Configure the environment to stream instance logs to Amazon CloudWatch Logs.

When you configure instance log streaming to CloudWatch Logs, Elastic Beanstalk creates CloudWatch Logs log groups for proxy and deployment logs on the Amazon EC2 instances, and transfers these log files to CloudWatch Logs in real time. For more information about instance logs, see Viewing Logs from Your Elastic Beanstalk Environment's Amazon EC2 Instances.

In addition to instance logs, if you enable enhanced health for your environment, you can configure the environment to stream health information to CloudWatch Logs. When the environment's health status changes, Elastic Beanstalk adds a record to a health log group, with the new status and a description of the cause of the change. For information about environment health streaming, see Streaming Elastic Beanstalk Environment Health Information to Amazon CloudWatch Logs.

Configuring Instance Log Viewing

To view instance logs, you can enable instance log rotation and log streaming in the Elastic Beanstalk console.

To configure instance log rotation and log streaming in the Elastic Beanstalk console

  1. Open the Elastic Beanstalk console.

  2. Navigate to the management page for your environment.

  3. Choose Configuration.

  4. On the Software configuration card, choose Modify.

  5. Under S3 log storage, choose Rotate logs to enable uploading rotated logs to Amazon S3.

  6. Under Instance log streaming to CloudWatch Logs, configure the following settings:

    • Log streaming – Choose to enable log streaming.

    • Retention – Specify the number of days to retain logs in CloudWatch Logs.

    • Lifecycle – Set to Delete logs upon termination to delete logs from CloudWatch Logs immediately if the environment is terminated, instead of waiting for them to expire.

  7. Choose Apply.

After you enable log streaming, you can return to the Software configuration card or page and find the Log Groups link. Click this link to see your instance logs in the CloudWatch console.


        CloudWatch logs settings for instance log streaming

Configuring Environment Health Log Viewing

To view environment health logs, you can enable environment health log streaming in the Elastic Beanstalk console.

To configure environment health log streaming in the Elastic Beanstalk console

  1. Open the Elastic Beanstalk console.

  2. Navigate to the management page for your environment.

  3. Choose Configuration.

  4. On the Monitoring configuration card, choose Modify.

  5. Under Health event streaming to CloudWatch Logs, configure the following settings:

    • Log streaming – Choose to enable log streaming.

    • Retention – Specify the number of days to retain logs in CloudWatch Logs.

    • Lifecycle – Set to Delete logs upon termination to delete logs from CloudWatch Logs immediately if the environment is terminated, instead of waiting for them to expire.

  6. Choose Apply.

After you enable log streaming, you can return to the Monitoring configuration card or page and find the Log Group link. Click this link to see your environment health logs in the CloudWatch console.


        CloudWatch logs settings for health event streaming

Log Viewing Namespaces

The following namespaces contain settings for log viewing: