Source: How to export logs from Stackdriver Logging: new solution documentation from Google Cloud Platform
By Charles Baer, Solutions Architect
Stackdriver Logging is broadly integrated with Google Cloud Platform (GCP), offering rich logging information about GCP services and how you use them. The Stackdriver Logging Export functionality allows you to export your logs and use the information to suit your needs.
There are lots of reasons to export your logs: to retain them for long-term storage (months or years) to meet compliance requirements; to run data analytics against the metrics extracted from the logs; or simply to import them into another system. Stackdriver Logging can export to Cloud Storage, BigQuery and Cloud Pub/Sub.
How you set up Logging Export on GCP depends on the complexity of your GCP organization, the types of logs to export and how you want to use the logs.
We recently put together a three-part solution that explores best practices for three common logging export scenarios:
For each scenario, we provide examples of export requirements, detailed setup steps, best practices and tips on using the exported logs.
We’re always looking for more feedback and suggestions on how to improve Stackdriver Logging. Please keep sending us your requests and feedback.