Google Cloud Logging Quickstart
Send your first Google Cloud Logging entries to Sazabi in 5 minutes
Google Cloud Logging Quickstart
Get logs from Google Cloud Logging into Sazabi in 5 minutes.
Google Cloud Logging is not available as an external backend yet. Use the Sazabi backend for your project and add Google Cloud Logging as a native data source so logs are forwarded into Sazabi storage. See Google Cloud Logging (native data source) for the full reference.
Prerequisites
- Sazabi account
- A GCP project with Cloud Logging enabled and billing enabled (required for Pub/Sub)
- IAM permissions to create a service account and attach roles (or a project owner who can do this for you)
Step 1: Use the Sazabi backend for your project
Forwarded logs are stored in Sazabi’s managed storage, so the project must use the Sazabi backend (the default for new projects). If you are unsure, open your project settings and confirm you are not using an external-only backend configuration. See Backend configuration for background on backends vs data sources.
Step 2: Create a GCP service account for Sazabi
In your GCP project, create a service account with these roles:
- Browser (
roles/browser) — list and browse projects via Cloud Resource Manager during setup - Logs Configuration Writer (
roles/logging.configWriter) - Pub/Sub Admin (
roles/pubsub.admin)
Example using the gcloud CLI:
# Create the service account
gcloud iam service-accounts create sazabi-logs \
--display-name="Sazabi Log Forwarding"
# Grant required roles
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member="serviceAccount:sazabi-logs@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/browser"
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member="serviceAccount:sazabi-logs@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/logging.configWriter"
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member="serviceAccount:sazabi-logs@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/pubsub.admin"Generate a JSON key for the service account and keep it secure:
gcloud iam service-accounts keys create sazabi-key.json \
--iam-account=sazabi-logs@YOUR_PROJECT_ID.iam.gserviceaccount.comStep 3: Connect Google Cloud Logging in Sazabi
- Log in to Sazabi and go to Settings > Data Sources
- Click Add Source and select Google Cloud Logging
- Upload the service account JSON key when prompted
- Select the GCP project to forward logs from
- Optionally add a log filter (leave empty to forward all logs in the project)
- Click Connect
Sazabi creates a log sink, Pub/Sub topic, and subscription in your project so matching logs stream to Sazabi.
Step 4: Verify logs are flowing
Generate activity in GCP (for example, invoke a Cloud Run service or Cloud Function), then:
- Open a chat thread in Sazabi
- Ask: "Show me recent GCP logs" or "What errors appeared in Cloud Run in the last hour?"
You should see new log entries in Sazabi within a few minutes. Historical logs in Cloud Logging are not backfilled automatically.
Troubleshooting
If logs are not appearing:
- Confirm billing is enabled on the GCP project (Pub/Sub requires it)
- Verify the service account has all three IAM roles listed above (including
roles/browser) - In Google Cloud Console, check Logging > Logs Router for the sink and Pub/Sub for the topic and subscription
- Allow a few minutes for new entries to propagate after connecting
For more detail, see Google Cloud Logging (native data source).
Next steps
- Set up alerting to get notified about errors
- Create a chat thread to investigate issues
- Add more data sources to get a complete picture of your stack