← Back to all fixes
AWS

Logs not appearing in CloudWatch

The Issue

Your app is running on EC2/ECS but no logs appear in CloudWatch.

Root Cause

CloudWatch agent not installed or configured, IAM role missing `logs:PutLogEvents` permission, or wrong log group name.

How to Fix
  1. For EC2: install and configure the CloudWatch agent — `sudo yum install amazon-cloudwatch-agent`
  2. For ECS: add `awslogs` log driver in task definition
  3. Check IAM role has: `logs:CreateLogGroup`, `logs:CreateLogStream`, `logs:PutLogEvents`
  4. Verify the log group exists in the same region as your service
  5. Check agent status: `sudo systemctl status amazon-cloudwatch-agent`