Why are my CloudWatch Logs costs so high?
By the Keel team · Last checked · 5 min read
Short answer
CloudWatch Logs charges for the log data you ingest, for storing it and for querying it, and AWS's documentation says log data is stored indefinitely by default unless you set a retention period. High bills usually come from a few noisy log groups, such as debug logging left on or repeated health check lines, plus groups that never expire. Cut the noise first, then set retention on every log group.
What does CloudWatch Logs charge for?
CloudWatch Logs charges for the data you ingest, for the log data you store and for the data scanned when you query it with Logs Insights.
The CloudWatch pricing page also prices vended logs separately, in tiers, and says pricing varies by Region.
The pricing page lists a free tier of 5 GB a month that covers ingestion, archive storage and data scanned by Logs Insights queries. That is small, so a busy production service will pass it quickly. Because ingestion is paid when the line is written, the volume you produce matters more than how long you keep it, but retention decides whether storage cost keeps growing.
How do you find which log group is costing the most?
Rank your log groups by how much each one ingests, then read a sample of the biggest.
The bill tells you CloudWatch Logs is expensive, but only the log groups tell you which service is responsible.
- Break the CloudWatch lines on your bill down to see whether ingestion, storage or queries dominate.
- Rank log groups by the volume each one ingests, using CloudWatch's per-log-group figures.
- Open a sample from the largest group and ask whether anyone would miss most of it.
- Note which environment it belongs to. Staging at debug level is a common cause.
How to work out which AWS service is driving your bill shows the breakdown method, and the minimum production monitoring a small SaaS needs helps you decide which signals are worth keeping.
What is the fastest way to cut ingestion?
Log less of what nobody reads.
Lowering the log level in production, dropping repetitive health check lines and avoiding full request and response bodies usually cut volume the most, because ingestion is paid per GB written.
- Run production at info or warn, and turn debug on temporarily and deliberately.
- Stop logging load balancer health check requests and other repetitive lines.
- Do not log full request and response bodies, which is also safer for personal data.
- Sample high-volume events instead of logging each one.
- Check that two agents are not shipping the same logs.
Illustrative arithmetic, with an assumed rate of $0.50 per GB ingested that is for the example only: a service writing 120 GB a month costs 120 x $0.50 = $60. If health checks and debug lines are 35% of the volume, removing them cuts 42 GB, saving 42 x $0.50 = $21 a month for that one service. Check the real London rate on the pricing page.
How do you set retention on every log group?
Set it in code and check it regularly.
AWS's documentation says that by default log data is stored in CloudWatch Logs indefinitely, that you can change retention for each log group at any time, and that any data older than the setting is deleted.
In Terraform, set retention on every log group you create:
resource "aws_cloudwatch_log_group" "app" {
name = "/ecs/my-app"
retention_in_days = 30
}To find groups that still never expire and set one by hand with the AWS CLI:
aws logs describe-log-groups \
--query "logGroups[?retentionInDays==null].logGroupName" \
--output text
aws logs put-retention-policy \
--log-group-name /ecs/my-app \
--retention-in-days 30AWS also documents account-level retention policies, which override a log group's own setting and have a 30 day minimum. Its example applies a policy to every log group whose name starts with a prefix, and its RETROACTIVE enforcement mode means older data in existing groups is deleted, so decide on the period deliberately before using it:
aws logs put-account-policy \
--policy-name LambdaRetentionPolicy \
--policy-type RETENTION_POLICY \
--policy-document '{"retentionInDays": 90, "enforcementMode": "RETROACTIVE"}' \
--selection-criteria 'LogGroupNamePrefix="/aws/lambda"'Illustrative storage arithmetic, with an assumed $0.03 per GB per month for the example only: a service adding 120 GB a month that never expires holds 1,440 GB after a year, costing 1,440 x $0.03 = $43.20 a month. With 30 day retention it holds about 120 GB, costing 120 x $0.03 = $3.60. AWS notes deletion can take up to 72 hours after the retention period. Retention must still meet any obligation to keep logs, as covered in how long to keep logs under UK GDPR.
Should you use the cheaper log class for rarely searched logs?
Sometimes, for logs you rarely read.
AWS's log class page says the Standard and Essentials classes, which was formerly called Infrequent Access, differ in ingestion costs only: storage and Logs Insights charges are the same in each class.
| Feature | Standard | Essentials |
|---|---|---|
| Ingestion charge | Standard rate | Priced differently, see the pricing page for your Region |
| Storage and Logs Insights charges | Same | Same |
| Live Tail | Yes | No |
| Metric filters | Yes | No |
| Subscription filters | Yes | No |
| Change class after creation | No | No |
Because a log group's class cannot be changed after creation, and metric filters are the usual route to log-based alarms, choose carefully. Audit-style logs you only search occasionally are a better fit than logs behind alerts. To read events from an Essentials group you use Logs Insights.
Should you move logs to another tool to save money?
Only after you have cut the noise, because any destination charges for the volume you send.
A cheaper rate on the same flood of debug lines is a smaller saving than not producing them.
If you do compare tools, compare them on the reduced volume, and account for what you lose, such as alarms built on metric filters. Keep the signals you act on, as in the minimum monitoring a small SaaS needs, and review log spend in your monthly AWS cost review so it does not creep back.
Are your log costs under control?
Tick each item that is true today.
- You know which log groups ingest the most.
- Production runs at info or warn, not debug.
- Health checks and repetitive lines are not logged.
- Every log group has a retention period set in code.
- Logs behind alerts use the Standard class.
- Log spend is part of your monthly cost review.
Decision point: Five or six ticks: log costs are managed. Three or fewer: run the describe-log-groups check above and set retention first, then tackle the noisiest group.
Sources
- AWS, Amazon CloudWatch pricing (checked November 2026)
- AWS docs, Working with log groups and log streams (checked November 2026)
- AWS docs, Log classes (checked November 2026)
Keep reading
Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.