Cloud Logging 是全代管服務,可讓您儲存、搜尋、分析、監控 Google Cloud 和 Amazon Web Services 中的記錄資料與事件,並接收相關快訊。您也可以使用 Bindplane,從 80 多個額外應用程式、地端部署系統和混合雲系統收集這項資料。
其中包括透過記錄 bucket 儲存記錄檔、稱為記錄檔探索器的使用者介面,以及以程式化方式管理記錄的 API。
Logging 可讓您讀取及寫入記錄項目、查詢記錄,以及控管記錄的轉送和使用方式。
使用價值 $300 美元的免費抵免額,開始進行概念驗證
-
取得 Gemini 2.0 Flash Thinking 的存取權
-
每月免費使用 AI API 和 BigQuery 等熱門產品
-
不會自動收費,也不會要求您一定要購買特定方案
繼續探索超過 20 項一律免費的產品
使用超過 20 項實用的免費產品,包括 AI API、VM 和 data warehouse 等。
訓練
訓練與教學課程
監控及記錄 Cloud Functions 運作情形
本實作實驗室課程說明如何在 Google Cloud 控制台中,查看 Cloud Run 函式的執行時間、執行次數和記憶體用量。這些指標也適用於 Cloud Monitoring。
訓練
訓練與教學課程
建立記錄指標並設定相關快訊
本實作實驗室課程說明如何使用系統和使用者定義的記錄指標,來建立圖表和快訊政策。
訓練
訓練與教學課程
安全性與存取分析
本教學課程說明如何將記錄檔從 Logging 匯出到 BigQuery,以符合您機構組織雲端基礎架構環境的安全性和分析需求。
用途
用途
將機構的記錄檔儲存至記錄檔值區
瞭解如何將貴機構的記錄檔儲存至單一來源。
記錄
記錄檔 Bucket
用途
用途
Google Kubernetes Engine 的多用戶群記錄功能。
瞭解如何為 GKE 叢集設定多用戶群記錄功能。
記錄
GKE
多租戶
用途
用途
使用記錄檔值區將專案記錄檔儲存至特定區域
瞭解如何將記錄檔資料儲存至指定區域。
資料落地
區域化
記錄
程式碼範例
程式碼範例
記錄項目:寫入
瞭解如何使用 Go、Java、Python、Node.js、C# 和 PHP 撰寫記錄檔項目
程式碼範例
程式碼範例
記錄項目:進階寫入
瞭解如何使用 Go、Java、Python、Node.js、C# 和 PHP 撰寫記錄檔項目
程式碼範例
程式碼範例
記錄項目:清單
瞭解如何使用 Go、Java、Python、Node.js、C# 和 PHP 列出記錄檔項目
程式碼範例
程式碼範例
記錄檔:刪除
瞭解如何使用 Go、Java、Python、Node.js、C# 和 PHP 刪除記錄檔項目
程式碼範例
程式碼範例
設定 Go 適用的 Cloud Logging
使用 Python 建立 VM 執行個體
程式碼範例
程式碼範例
更多範例
更多記錄專用範例
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-03 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-03 (世界標準時間)。"],[],[],null,["# Cloud Logging documentation\n===========================\n\n[Read product documentation](/logging/docs/overview) **Cloud Logging** is a fully managed service that allows you to\nstore, search, analyze, monitor, and alert on logging data and events from\nGoogle Cloud and Amazon Web Services. Using\n[Bindplane](https://bindplane.com/google),\nyou can also collect this data from over 80 additional applications,\non-premises systems, and hybrid cloud systems.\n\nLogging includes storage for logs through\n[log buckets](/logging/docs/buckets), a user interface called the\n[Logs Explorer](/logging/docs/view/logs-viewer-interface), and\n[an API](/logging/docs/reference/api-overview) to manage logs programmatically.\nLogging lets you read and write log entries, query your logs, and control how you\nroute and use your logs.\n[Get started for free](https://console.cloud.google.com/freetrial) \n\n#### Start your proof of concept with $300 in free credit\n\n- Get access to Gemini 2.0 Flash Thinking\n- Free monthly usage of popular products, including AI APIs and BigQuery\n- No automatic charges, no commitment \n[View free product offers](/free/docs/free-cloud-features#free-tier) \n\n#### Keep exploring with 20+ always-free products\n\n\nAccess 20+ free products for common use cases, including AI APIs, VMs, data warehouses,\nand more.\n\nDocumentation resources\n-----------------------\n\nFind quickstarts and guides, review key references, and get help with common issues. \nformat_list_numbered\n\n### Guides\n\n-\n\n [Quickstart: Write and query log entries with the gcloud CLI](/logging/docs/write-query-log-entries-gcloud)\n\n-\n\n [Quickstart: Write and query log entries using a Python script](/logging/docs/write-query-log-entries-python)\n\n-\n\n [Using the Logs Explorer](/logging/docs/view/logs-viewer-interface)\n\n-\n\n [Logging query language](/logging/docs/view/logging-query-language)\n\n-\n\n [Building queries](/logging/docs/view/building-queries)\n\n-\n\n [Log Router overview](/logging/docs/routing/overview)\n\n-\n\n [About the Ops Agent](/logging/docs/agent/ops-agent)\n\n-\n\n [Log-based metrics](/logging/docs/logs-based-metrics)\n\n-\n\n [More guides](/logging/docs/overview)\n\nfind_in_page\n\n### Reference\n\n-\n\n [REST API](/logging/docs/reference/v2/rest)\n\n-\n\n [RPC API](/logging/docs/reference/v2/rpc)\n\n-\n\n [Logging Client Libraries](/logging/docs/reference/libraries)\n\n-\n\n [Command-line interface](/logging/docs/reference/tools/gcloud-logging)\n\n-\n\n [Monitored resources and services](/logging/docs/api/v2/resource-list)\n\n-\n\n [Introduction to the Cloud Logging API v2](/logging/docs/reference/api-overview)\n\n-\n\n [More references](/logging/docs/reference)\n\ninfo\n\n### Resources\n\n-\n\n [Quotas and limits](/logging/quotas)\n\n-\n\n [Release notes](/logging/docs/release-notes)\n\n-\n\n [Pricing](https://cloud.google.com/stackdriver/pricing)\n\n-\n\n [More resources](/logging/quotas)\n\nRelated resources\n-----------------\n\nTraining and tutorials \nUse cases \nCode samples \nExplore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Training \nTraining and tutorials\n\n### Monitoring and logging for Cloud Functions\n\n\nThis hands-on lab shows you how to view your Cloud Run functions with\ntheir execution times, execution counts, and memory usage in the Google Cloud console. These metrics are also available in Cloud Monitoring.\n\n\n[Learn more](https://www.cloudskillsboost.google/catalog_lab/1110) \nTraining \nTraining and tutorials\n\n### Creating and alerting on logs-based metrics\n\n\nThis hands-on lab shows you how to use both system and user-defined\nlogs-based metrics to create charts and alerting policies.\n\n\n[Learn more](https://www.cloudskillsboost.google/catalog_lab/753) \nTraining \nTraining and tutorials\n\n### Security and access analytics\n\n\nThis tutorial shows how to export logs from Logging to BigQuery to meet the security and analytics requirements of your\norganization's cloud infrastructure environment.\n\n\n[Learn more](/solutions/exporting-stackdriver-logging-for-security-and-access-analytics) \nUse case \nUse cases\n\n### Storing your organization's logs in a log bucket\n\n\nLearn how to store your organization's logs in a single source.\n\nLogging Logs Buckets\n\n\u003cbr /\u003e\n\n[Learn more](/logging/docs/central-log-storage) \nUse case \nUse cases\n\n### Multi-tenant logging on Google Kubernetes Engine.\n\n\nLearn how to configure multi-tenant logging for GKE clusters.\n\nLogging GKE Multi-tenant\n\n\u003cbr /\u003e\n\n[Learn more](/stackdriver/docs/solutions/gke/multi-tenant-logging) \nUse case \nUse cases\n\n### Regionalizing your project's logs using log buckets\n\n\nLearn how to store your logs data in a designated region.\n\nData residency Regionalization Logging\n\n\u003cbr /\u003e\n\n[Learn more](/logging/docs/regionalized-logs) \nCode sample \nCode Samples\n\n### Log Entries: Write\n\n\nLearn how to write log entries in Go, Java, Python, Node.js, C#, and PHP\n\n\n[Get started](/logging/docs/samples/logging-write-log-entry) \nCode sample \nCode Samples\n\n### Log Entries: Advanced Write\n\n\nLearn how to write log entries in Go, Java, Python, Node.js, C#, and PHP\n\n\n[Get started](/logging/docs/samples/logging-write-log-entry-advanced) \nCode sample \nCode Samples\n\n### Log Entries: List\n\n\nLearn how to list log entries in Go, Java, Python, Node.js, C#, and PHP\n\n\n[Get started](/logging/docs/samples/logging-list-log-entries) \nCode sample \nCode Samples\n\n### Logs: Delete\n\n\nLearn how to delete log entries in Go, Java, Python, Node.js, C#, and PHP\n\n\n[Get started](/logging/docs/samples/logging-delete-log) \nCode sample \nCode Samples\n\n### Setting up Cloud Logging for Go\n\n\nCreate a VM instance with Python\n\n\n[Get started](/logging/docs/setup/go) \nCode sample \nCode Samples\n\n### More samples\n\n\nMore logging-specific samples\n\n\n[Learn more](/logging/docs/samples)\n\nRelated videos\n--------------"]]