Viewing CloudWatch Logs Live Tail for Amazon ECS services and tasks
CloudWatch Logs Live Tail helps you quickly troubleshoot incidents by viewing a streaming list of new log events as they are ingested. You can view task and service events in the Amazon ECS console. This view provides a cohesive view of your task and service health.
Each task in an Amazon ECS service has dedicated log streams for each container. If a service scales up, each task instance has its own set of log streams. The naming convention for log streams follows the pattern:
log-group-prefix
/container-name
/task-id
A single task writes to the same log streams during its lifetime. The log stream contains messages from that task's containers and also any output from your application code. Every message is timestamped, including your custom logs.
Note
Live Tail sessions incur costs by session usage time, per minute. For more information about pricing, see Amazon CloudWatch Pricing
Required permissions
The following permissions are required for the console IAM user to start and stop CloudWatch Logs Live Tail sessions:
-
logs:DescribeLogGroups
-
logs:StartLiveTail
-
logs:StopLiveTail
Procedure
Open the console at https://console.aws.amazon.com/ecs/v2
. -
Determine the resource you want to view
Resource Steps Tasks -
On the Clusters page, choose the cluster.
The cluster details page displays.
-
Choose the Tasks tab.
The task details page displays.
-
Choose the Logs tab.
Services -
On the Clusters page, choose the cluster.
The cluster details page displays.
-
Choose the service.
The service details page displays.
-
Choose the Logs tab.
-
-
Choose CloudWatch Logs Live Tail, and then choose Start.
-
(Optional) To filter the streams, under Filter, for Select log groups, choose the log group.
AWS CLI references
You can also use the AWS CLI to start Live Tail sessions for CloudWatch Logs. The following resources provide detailed information about using the AWS CLI with Live Tail:
-
start-live-tail command reference - Complete command syntax, parameters, and examples for the
aws logs start-live-tail
command. -
CloudWatch Logs Live Tail user guide - Comprehensive guide including AWS CLI usage with both print-only and interactive modes.
-
StartLiveTail SDK examples - Programmatic examples for using the StartLiveTail API with various AWS SDKs.