Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
ログをダウンロードする
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
App Engine は、Python 標準ライブラリの
logging
モジュールを使用してアプリケーションが発行するメッセージのログ、および標準エラーストリームに出力される他のメッセージを保持します。また、それぞれのリクエストも記録されます。各ログの重大度レベル(4: CRITICAL、3: ERROR、2: WARNING、1: INFO、0: DEBUG)のバッファサイズは固定されており、アクセスできるログ情報の量が制御されます。通常、ログ機能は低いログレベルで使用することが多いため、そのような低いログレベルのほうが、ログイベントの期間は小さくなります。ログに記録された各リクエストには、
リクエスト ID が割り当てられます。これは、リクエストの開始時間に基づく、グローバルで一意の識別子です。
アプリの過去 90 日間のログを参照する場合は、 Google Cloud コンソールの[ログ] ページを使用することもできます。
ログのリクエスト
appcfg
ツールについては、現在サービスを終了しています。代わりとなる Google Cloud CLI は、ログのダウンロード機能をサポートしていませんが、gcloud app logs
コマンドを使用してログを表示できます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","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 UTC。"],[[["\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)."]]