Explanation
Why the waste happens and who it affects.
Log bucket cost comes mainly from the per-GiB storage charge applied when logs are written, which includes 30 days of retention; longer retention adds a per GiB-month charge. Routing rarely used logs to Cloud Storage (for example Coldline or Archive with lifecycle rules) can lower long-term cost, but only if the same logs are also excluded from the _Default or other log buckets; otherwise both destinations are paid. BigQuery suits logs that need analysis rather than cheaper storage. Choosing the optimal storage destination based on access frequency and analytics needs is essential to control log retention costs.
Billing model
The pricing dimensions that drive this cost.
Log buckets charge per GiB of logs stored, which includes the first 30 days of retention, plus a per GiB-month charge for longer retention. Exported logs incur costs in the target service - Logging buckets (per GB ingested/stored) Cloud Storage (per GiB stored and retrieved), BigQuery (per GiB stored and queried), or Pub/Sub (per GiB). Selecting the wrong destination or storage class can lead to higher-than-necessary long-term costs.
How to detect
3 checks to find it in your estate.
- Review current log storage destinations and retention periods across projects and organizations
- Identify logs stored in Cloud Logging buckets that have not been queried or accessed recently
- Assess whether archival or analytical needs justify retention in Cloud Logging versus BigQuery or Cloud Storage
How to fix
3 ways to remove the waste.
- Redirect logs to cost-effective destinations such as Cloud Storage (Coldline or Archive with lifecycle rules for compliance retention) or BigQuery (for analytics) using sinks.
- Add exclusion filters to the _Default sink (or any other sink that writes to a log bucket) for logs routed elsewhere, so they are not also stored and charged in Cloud Logging
- Use BigQuery partitioning and clustering to reduce query and storage costs for analytical log data
Documentation
Vendor references for pricing and configuration.