| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
You can access logs from the Amazon EC2 instances running your applications. There are two ways to do this:
Snapshot the logs and view them in the Elastic Beanstalk console.
Configure your environment to automatically publish logs to an S3 bucket.
This topic explains how to access your logs using both methods.
To take a snapshot and view logs
Open the AWS Elastic Beanstalk console at https://console.aws.amazon.com/elasticbeanstalk/.
Navigate to the logs for your application.
Select your application from the drop-down list at the top.
Below the application selection drop-down list, click Environment Details for your application in the application's Environments list.
Click the Logs tab.
Click the Snapshot Logs button.
This action takes a snapshot of the logs for your AWS Elastic Beanstalk application. The log file appears in the Logs panel.
Note
It takes several seconds to retrieve the log files. You may need to click the Refresh button to see the contents of the log files.

Click the View log file link.
A web page displaying the text output of the log file snapshot opens.
A copy of the tail logs is placed in the Amazon S3 bucket associated with your application for 15 minutes. Depending on whether you are using a legacy or non-legacy container, you can access these logs in one of the following locations. If you are not sure if you are using a legacy or non-legacy container, see To check if you are using a legacy container type.
non-legacy — elasticbeanstalk-region-account
id/resources/environments/logs/tail/environment ID/instance ID/
You can find your instance ID on the Logs tab as shown in the previous diagram.
You can find your environment ID on the Server tab in the Edit Configuration dialog box. You can access this dialog box from the Overview tab in the Environment Details pane.

legacy — Use the RetrieveEnvironmentInfo API to
retrieve the location for the tail logs. For the CLI reference for this API, see
elastic-beanstalk-retrieve-environment-info. For the API
reference, go to RetrieveEnvironmentInfo in the AWS Elastic Beanstalk API
Reference.
You can configure your environment so that the logs from the Amazon EC2 instances running your applications are copied by AWS Elastic Beanstalk to the Amazon S3 bucket associated with your application.
Configure your environment to publish logs to Amazon S3.
Open the AWS Elastic Beanstalk console at https://console.aws.amazon.com/elasticbeanstalk/.
Select your application from the drop-down list at the top.
Below the application selection drop-down list, click Environment Details for your application in the application's Environments list.
Click Edit Configuration.
From the Container tab, select Enable log file rotation to Amazon S3, and then click Apply Changes.
Access your logs.
Open the Amazon S3 console at https://console.aws.amazon.com/s3/.
Depending on whether you are using a legacy or non-legacy container, navigate to one of the Amazon S3 locations. If you are not sure if you are using a legacy or non-legacy container, see To check if you are using a legacy container type.
legacy — elasticbeanstalk-region-account
id/environment name/logs/instance ID/
For instructions on accessing your instance ID, see Listing and Connecting to Server Instances.
non-legacy — elasticbeanstalk-region-account
id/resources/environments/logs/publish/environment ID/instance ID/
For instructions on accessing your instance ID, see Listing and Connecting to Server Instances.
You can find your environment ID on the Server tab in the Edit Configuration dialog box. You can access this dialog box from the Overview tab in the Environment Details pane.
