How to Retain Logs for 12 Months?
Since you need logs beyond one month, you have a few options:
- Upgrade Log Retention Using Log Buckets
You can create a custom log bucket with a 12-month retention policy.
Logs need to be routed to this bucket before they expire.
Steps:
Go to Cloud Logging → Log Router
Create a new log bucket
Set retention to 12 months
Update your log sinks to route logs to this bucket.
2.Export Logs to Cloud Storage, BigQuery, or Pub/Sub
If the logs are already deleted, you cannot retrieve them.
To store logs long-term, export them to:
Cloud Storage (for raw logs, cheaper storage).
BigQuery (for querying logs over time).
Pub/Sub (for streaming logs to other services).
- Support Plan Limitation
You can try asking in the GCP Community Forum or consider upgrading to a Standard or Enhanced support plan.
Cost Considerations
Storing logs in Cloud Logging beyond default retention incurs additional storage costs.
Exporting to Cloud Storage (Coldline/Archive storage) is the most cost-effective for long-term retention.
Thanks,
Darwin Vinoth.
Linkedin