Search code examples
google-cloud-platformgoogle-cloud-storagegoogle-cloud-buildgoogle-cloud-logging

Difference between storing Google Cloud Build logs in Cloud Logging vs storing them in GCS


Google Cloud Build allows us to store logs in either GCS or Cloud Logging or both or none. I just want to know what difference it makes when storing logs in GCS vs storing them in Cloud Logging. Maybe some of the things you can highlight are:

  • Advantages and disadvantages, or typical scenarios when I should use one over the other.
  • Difference in pricing, which may cost more than the other.

Solution

  • It's 2 different places with different features

    Cloud Logging buckets allow you to

    • Store data during a different retention periods
    • Query the data from Cloud Logging (and soon via SQL expression)
    • Sink the logs from different projects in a single place (I wrote an article on that)
    • Use cloud monitoring/cloud alerting features

    Cloud Storage sink allows you to

    • Store data during a different retention periods, with different storage class cost
    • Sink the logs from different projects in a single bucket
    • Move, copy, manage your files as you wish.
    • Ingest log file in third party tool (like splunk)

    IMO, the main difference is the query capacity and the Cloud Monitoring and Alerting integration. Things that you loose when you store logs in Cloud Storage.

    However, you gain file management with Cloud Storage.