Python 2.7 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 Python 2.7 應用程式,即使貴機構先前曾使用機構政策重新啟用舊版執行階段的部署作業,也無法部署。現有的 Python 2.7 應用程式在
淘汰日期過後,仍會繼續執行並接收流量。建議您
改用系統支援的最新 Python 版本。
下載記錄
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
App Engine 會使用 Python 標準程式庫的
logging
模組來保留應用程式發出的訊息記錄,以及輸出至標準錯誤訊息串的其他訊息。App Engine 也會在記錄中記錄每個要求。每種記錄嚴重性等級 (4 代表 CRITICAL、3 代表 ERROR、2 代表 WARNING、1 代表 INFO、0 代表 DEBUG) 都有固定的緩衝區空間,以控制您可以存取的記錄資訊量。一般來說,使用記錄功能時大多在較低的記錄層級使用;因此,這些層級的記錄事件時間範圍較小。每個記錄的要求都有系統指派的
要求 ID,這是根據要求開始時間編號的全域不重複 ID。
如要瀏覽應用程式過去 90 天的記錄,您也可以使用 Google Cloud 主控台的「Logs」頁面。
要求記錄檔
appcfg
工具現已關閉。做為替代工具的 Google Cloud CLI 不支援下載記錄檔的功能。不過您可以使用 gcloud app logs
指令來查看記錄檔。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-04 (世界標準時間)。
[[["容易理解","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-04 (世界標準時間)。"],[[["\u003cp\u003eApp Engine logs messages from the Python \u003ccode\u003elogging\u003c/code\u003e module and standard error stream, as well as every request.\u003c/p\u003e\n"],["\u003cp\u003eLog severity levels range from 0 (DEBUG) to 4 (CRITICAL), each having a buffer size that impacts accessible log information.\u003c/p\u003e\n"],["\u003cp\u003eEach logged request has a unique request ID, based on its start time, which can be used for reference.\u003c/p\u003e\n"],["\u003cp\u003eLogs from the last 90 days can be viewed through the Logs page in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eWhile the \u003ccode\u003eappcfg\u003c/code\u003e tool is shut down, logs can still be viewed using the \u003ccode\u003egcloud app logs\u003c/code\u003e commands within the Google Cloud CLI.\u003c/p\u003e\n"]]],[],null,["# Downloading Logs\n\nApp Engine maintains a log of messages that your application emits using the `logging` module from the Python standard library, as well as other messages printed to the standard error stream. App Engine also records each request in the log. Each log severity level (4 for CRITICAL, 3 for ERROR, 2 for WARNING, 1 for INFO, 0 for DEBUG) has a fixed buffer size that controls the amount of log information you can access. Normally, you use logging features more at lower log levels; thus, the time window is smaller for log events at these levels. Each request logged is assigned a [request ID](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.logservice.logservice#google.appengine.api.logservice.logservice.RequestLog.request_id), a globally unique identifier based on the request's start time.\n\nTo browse your app's logs of the last 90 days, you can also use the\n[Logs page](https://console.cloud.google.com/logs) in the Google Cloud console.\n\nRequesting the logs\n-------------------\n\nThe `appcfg` tool is now [shut down](/appengine/docs/legacy/standard/python/sdk-gcloud-migration).\nThe replacement, [Google Cloud CLI](/sdk/docs), does not support the ability to\ndownload logs; however, you can view your logs using the\n[`gcloud app logs` commands](/sdk/gcloud/reference/app/logs)."]]