Cloud Logging is GCP's unified log management service that automatically collects, searches, and analyzes logs from every GCP service. Powerful search via Logging Query Language (LQL), flexible routing through Log Router, and compliance support via Audit Logs are its core capabilities.
| Bucket | Retention | Use Case |
|---|---|---|
| _Default | 30 days (configurable, up to 10 years) | Default log destination |
| _Required | 400 days (fixed) | Admin Activity / System Event / Policy Denied |
| Custom | 1 day to 10 years | Long-term retention, Log Analytics |
# 特定サービスのエラー resource.type="cloud_run_revision" resource.labels.service_name="my-api" severity>=ERROR # 特定 JSON フィールド jsonPayload.user_id="user-123" jsonPayload.duration_ms>1000 # 時間範囲 timestamp>="2026-05-01T00:00:00Z" timestamp<="2026-05-31T23:59:59Z" # 否定 + AND/OR severity=(ERROR OR CRITICAL) NOT textPayload:"health check" # Audit log で特定操作 protoPayload.methodName="storage.buckets.delete" protoPayload.authenticationInfo.principalEmail="[email protected]"
| Type | Description | Pricing |
|---|---|---|
| Admin Activity | Resource changes (always on, cannot be disabled) | Free |
| Data Access | Data reads / writes (must be enabled) | $0.50/GiB |
| System Event | System operations initiated by Google | Free |
| Policy Denied | IAM / VPC SC denials | Free |
# Counter: ERROR ログ件数 filter: 'resource.type="cloud_run_revision" severity>=ERROR' metric_kind: DELTA value_type: INT64 # Distribution: API レスポンス時間 filter: 'jsonPayload.event="api_request"' value_extractor: 'EXTRACT(jsonPayload.duration_ms)'
| Item | Price |
|---|---|
| Ingestion | $0.50/GiB |
| Storage (beyond 30 days) | $0.01/GiB/month |
| Free tier | 50 GiB of monthly ingestion |
| Log Router | Free (destination charges like BigQuery are separate) |
| Log Analytics | Free (Storage is billed separately) |
| Item | Cloud Logging | CloudWatch Logs | Azure Monitor Logs |
|---|---|---|---|
| Query language | LQL | CloudWatch Logs Insights | KQL |
| Retention | 30 days to 10 years | 1 day to indefinite | 4 days to 2 years (+ Archive) |
| Ingestion price | $0.50/GiB | $0.50/GiB | $2.30/GB |
| Long-term analytics | Log Analytics (BQ) | S3 export | Workspace |
What is the log retention period in Cloud Logging?
_Default Bucket = 30 days, _Required Bucket = 400 days (Audit Logs). Custom Buckets can retain logs for up to 10 years.
What is the log query language?
Logging Query Language (LQL). It uses a SQL-like syntax to filter by resource.type, severity, jsonPayload, and more.
What is a Log-based Metric?
Automatically generates Counter / Distribution metrics from logs. Example: convert ERROR log counts into a time-series metric and wire it up to alerts.
What can you do with Log Router (Sink)?
Routes logs to BigQuery / Cloud Storage / Pub/Sub / another Log Bucket. Essential for long-term analytics, SIEM integration, and cost optimization.
How many types of Audit Logs are there?
Admin Activity (always on), Data Access (must be enabled), System Event (always on), and Policy Denied (always on). Data Access generates by far the largest volume.
What is the pricing model?
Ingestion $0.50/GiB, storage $0.01/GiB/month (after 30 days). Includes 50 GiB of free monthly ingestion. Audit Admin Activity and System Event logs are free.
How does it compare to AWS CloudWatch Logs / Azure Monitor Logs?
GCP wins on LQL power; AWS uses CloudWatch Logs Insights; Azure uses KQL. GCP's strength is the combination of automatic GKE / Cloud Run collection plus LQL.
Can I send logs via OpenTelemetry?
Yes. Send logs to Cloud Logging via the OpenTelemetry Collector to avoid vendor lock-in on the application side.
Related Articles: Observability
GCP Professional Cloud Developer (PCD) 完全ガイド|Cloud Run・GKE・CI/CD・APM
Google Cloud Professional Cloud Developer の試験範囲、Cloud Run / GKE / Cloud Build / Cloud Trace、AWS DVA / Azure AZ-204 比較、学習ロードマップを徹底解説。
Eventarc 完全ガイド|CloudEvents・90+ イベントソース・サーバレストリガー (GCP)
Google Cloud Eventarc の全機能解説。CloudEvents 標準、Cloud Audit Logs / GCS / Pub/Sub トリガー、Cloud Run / Functions / Workflows ターゲット、料金、AWS EventBridge 比較を網羅。
GCP Professional Cloud Network Engineer (PCNE) 完全ガイド|VPC・Interconnect・Load Balancing
Google Cloud Professional Cloud Network Engineer の試験範囲、VPC / Cloud Interconnect / Cloud Load Balancing / Cloud Armor、AWS ANS・Azure AZ-700 比較を詳解。
Cloud Build 完全ガイド|CI/CD・cloudbuild.yaml・Private Pool・GitHub 連携 (GCP)
Google Cloud Cloud Build の全機能解説。cloudbuild.yaml、トリガー設定、Private Pool、Workload Identity、Build Approvals、Cloud Deploy 連携、AWS CodeBuild / Azure DevOps 比較を網羅。
Note: Google Cloud is a trademark of Google LLC. For the latest information, see the official Cloud Logging documentation.
Practice with certification-focused question sets
Go to the GCP exam prep pageNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Google Cloud Certification Roadmap (2026)
Choose your GCP certification path — Foundational, Associate...
CDL Cloud Digital Leader: Complete Exam Guide (2026)
Pass the Cloud Digital Leader exam — cloud business value, G...
GAIL Generative AI Leader: Complete Exam Guide (2026)
Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...
Vertex AI Fundamentals for GCP Certs (2026)
Vertex AI basics every cert candidate needs — Workbench, Pip...
Associate Cloud Engineer (ACE): Complete Guide (2026)
Pass the Associate Cloud Engineer exam — Console, gcloud, pr...