- Newest
- Most votes
- Most comments
There hasn't been a general change in AWS that would prevent ECS Tasks/Services from showing logs. However, the issue you're experiencing could be due to a few potential reasons:
-
Log configuration: Ensure that your task definitions have the correct log configuration. The log driver should be set to 'awslogs' for CloudWatch Logs integration. Check if the 'logConfiguration' property in your task definition is correctly set.
-
Region mismatch: Verify that the log group is in the same region as your ECS cluster. The ECS console can only display logs from CloudWatch Logs groups in the same region as the cluster. If your log group is in a different region, you won't be able to view the logs directly from the ECS console.
-
IAM permissions: Check if there have been any changes to the IAM roles associated with your tasks. The task execution role needs permissions to write to CloudWatch Logs.
-
Log group existence: Confirm that the specified log group exists in CloudWatch. If you're using a new log group name, make sure it's being created correctly.
-
Log stream prefix: For logs to appear in the ECS console's Log pane, you need to specify a stream prefix. This is typically done using the 'awslogs-stream-prefix' option in the log configuration.
-
CDK changes: Review any recent changes in your CDK code that might have affected the log configuration for your tasks.
To troubleshoot further:
- Review your task definition to ensure the log configuration is correct.
- Check CloudWatch Logs directly to see if logs are being written there.
- Verify IAM permissions for the task execution role.
- Ensure the log group exists and is in the correct region.
- Review your CDK code for any unintended changes to logging configuration.
If you've verified all these points and are still experiencing issues, you may want to reach out to AWS support for further assistance.
Sources
interface LogConfigurationProperty · AWS CDK
ECS Container logs cannot be displayed if the log group is in a different region | AWS re:Post
