Using Error Reporting with regionalized logs

Error Reporting is a global service built on Cloud Logging. In order to count, analyze, and aggregate errors found in your logs, Error Reporting stores metadata, including samples of log messages, in its own global database. As a result, it can only analyze logs stored in Cloud Logging buckets that are in the global region where the source and destination Google Cloud projects are the same.

If you route logs to a different Cloud project or to regionalized buckets, then Error Reporting doesn't capture and analyze those logs.

Checking if Error Reporting can analyze your logs

To see if Error Reporting can analyze your logs, verify that you are storing your logs in buckets in the global region where the source and destination Cloud projects are the same.

Run the following command to see a list of sinks you have configured:

gcloud logging sinks list

The command returns output similar to the following:

NAME               DESTINATION                                                                                                FILTER
_Default           logging.googleapis.com/projects/my-team-project/locations/global/buckets/_Default                          NOT LOG_ID("cloudaudit.googleapis.com/activity") AND NOT LOG_ID("externalaudit.googleapis.com/activity") AND NOT LOG_ID("cloudaudit.googleapis.com/system_event") AND NOT LOG_ID("externalaudit.googleapis.com/system_event") AND NOT LOG_ID("cloudaudit.googleapis.com/access_transparency") AND NOT LOG_ID("externalaudit.googleapis.com/access_transparency")
_Required          logging.googleapis.com/projects/my-team-project/locations/global/buckets/_Required                         LOG_ID("cloudaudit.googleapis.com/activity") OR LOG_ID("externalaudit.googleapis.com/activity") OR LOG_ID("cloudaudit.googleapis.com/system_event") OR LOG_ID("externalaudit.googleapis.com/system_event") OR LOG_ID("cloudaudit.googleapis.com/access_transparency") OR LOG_ID("externalaudit.googleapis.com/access_transparency")
logs-from-samples  logging.googleapis.com/projects/my-team-project/locations/global/buckets/sample-bucket                     (empty filter)
regional_logs      logging.googleapis.com/projects/my-team-project/locations/europe-west1/buckets/bucket_for_regional_logs    (empty filter)
test-logs          logging.googleapis.com/projects/team-b-project/locations/global/buckets/test-bucket                        (empty filter)

In this example, the source Google Cloud project of the logs is my-team-project. As a result:

  • Error Reporting can analyze the logs routed by the _Default, _Required, and logs-from-samples sinks since they are routing logs to buckets that are in the global region within the same project.
  • Error Reporting can't analyze logs routed by the regional_logs sink since it routes logs to a regional bucket in the europe-west1 region.
  • Error Reporting can't analyze logs routed by the test-logs sink since it routes logs to a different project (team-b-project) than the source project.