View a markdown version of this page

Viewing your Elastic Beanstalk environment logs - AWS Elastic Beanstalk

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 Amazon EC2 instances in your Elastic Beanstalk environment.

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, and in the Regions list, select your AWS Region.

  2. In the navigation pane, choose Environments, and then choose the name of your environment from the list.

  3. In the navigation pane, choose Configuration.

  4. In the Updates, monitoring, and logging configuration category, choose Edit.

  5. In the S3 log storage section, select Activated beneath Rotate logs to enable uploading rotated logs to Amazon S3.

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

    • Log streaming – Select Activated 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. To save the changes choose Apply at the bottom of the page.

After you enable log streaming, Elastic Beanstalk displays the streamed CloudWatch Logs log groups in the environment management console, on the Logs page. Choose a log group to view its log events in a built-in viewer—Elastic Beanstalk automatically selects the most recently active log stream, and you can switch streams, search and filter events, and load earlier events.

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, and in the Regions list, select your AWS Region.

  2. In the navigation pane, choose Environments, and then choose the name of your environment from the list.

  3. In the navigation pane, choose Configuration.

  4. In the Updates, monitoring, and logging configuration category, choose Edit.

  5. Go to the Monitoring section.

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

    • Log streaming – Choose to Activated 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. To save the changes choose Apply at the bottom of the page.

Log viewing namespaces

The following namespaces contain settings for log viewing:

Warning Javascript is disabled or is unavailable in your browser.

To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.

AltStyle によって変換されたページ (->オリジナル) /