Viewing the container logs of your Amazon Lightsail container services
Last updated: November 12, 2020
Every container in your Amazon Lightsail container service deployment generates a log. The container logs provide the stdout and stderr streams of processes that run inside your containers. Access your containers' logs periodically to diagnose their operations. The latest three days of log entries are stored before the oldest ones are replaced by the newest entries.
Filtering container logs
Container logs can have hundreds of entries per day. Use the filtering options to reduce the number of entries displayed in your log window, and make it easier to find what you're looking for. You can filter container logs by a start and end date (in local time), and by a specific term. When filtering by a term, you can choose to include or exclude log entries for the term you specify.

The include or exclude filter term looks for an
exact match that is case-sensitive. For example, if you specify to include only log events
that have HTTP
in the message, then you will see all log events that include
HTTP
in the message, but none that include http
in the message. If
you specify to exclude Error
, then you will see all log events that don't include
Error
in the message, and you will also see log events that include
ERROR
in the message.
Prerequisites
Before you get started, you need to create a Lightsail container service. For more information, see Creating Amazon Lightsail container services.
You also should create a deployment in your container service that configures and launches your containers. For more information, see Creating and managing deployments for your Amazon Lightsail container services.
Viewing the container logs of a container service
Complete the following procedure to view the container logs of your Lightsail container service.
Sign in to the Lightsail console.
On the Lightsail home page, choose the Containers tab.
Choose the name of the container service for which you want to view the container logs.
On the container service management page, choose the Deployments tab.
The Deployments page lists your current deployment and deployment versions, if any.
Choose one of the following options to view container logs:
To access the container logs of the current deployment, choose Open log for the container entries under the Current deployment section of the page.
To access the container logs of a previous deployment, choose the actions menu icon (⋮) for a previous deployment under the Deployment versions section of the page, and then choose Show details. In the Version details page that appears, choose Open log for the container entries that are listed.
The container log opens in a new browser window. You can scroll down to view more log entries, and refresh the page to load the newest set of entries. The filtering options are displayed at the bottom of the page.
Note
Log entries are displayed in ascending order, and in Coordinated Universal Time (UTC). That is, the oldest log entries are at the top, and you must scroll down to see newer log entries.
Additional information about container services
These are the general steps to manage your Lightsail container service after it's up and running:
Get familiar with all of the elements of Lightsail container services. For more information, see Container services in Amazon Lightsail.
Create your container service in your Lightsail account. For more information, see Creating Amazon Lightsail container services.
If you plan to use container images from a public registry, find container images from a public registry such as the Amazon ECR Public Gallery. For more information about Amazon ECR Public, see What Is Amazon Elastic Container Registry Public? in the Amazon ECR Public User Guide.
If you plan to push container images from your local machine to your service, install software on your local machine that you need to create your own container images and push them to your Lightsail container service. For more information, see the following guides:
Create a deployment in your container service that configures and launches your containers. For more information, see Creating and managing deployments for your Amazon Lightsail container services.
View previous deployments for your container service. You can create a new deployment using a previous deployment version. For more information, see Viewing and managing deployment versions of your Amazon Lightsail container services.
View the logs of containers on your container service. For more information, see Viewing the container logs of your Amazon Lightsail container services.
Create an SSL/TLS certificate for the domains that you want to use with your containers. For more information, see Creating SSL/TLS certificates for your Amazon Lightsail container services.
Validate the SSL/TLS certificate by adding records to the DNS of your domains. For more information, see Validating SSL/TLS certificates for your Amazon Lightsail container services.
Enable custom domains by attaching a valid SSL/TLS certificate to your container service. For more information, see Enabling and managing custom domains for your Amazon Lightsail container services.
Monitor the utilization metrics of your container service. For more information, see Viewing container service metrics in Amazon Lightsail.
(Optional) Scale the capacity of your container service vertically, by increasing its power specification, and horizontally, by increasing its scale specification. For more information, see Changing the capacity of your Amazon Lightsail container services.
Delete your container service if you're not using it to avoid incurring monthly charges. For more information, see Deleting Amazon Lightsail container services.