Java 8 已达到支持终止期限,并将于 2026 年 1 月 31 日
弃用。弃用后,您将无法部署 Java 8 应用,即使您的组织之前曾使用组织政策重新启用旧版运行时的部署,也无法部署。现有的 Java 8 应用在
弃用日期之后将继续运行并接收流量。我们建议您
迁移到最新支持的 Java 版本。
下载日志
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
App Engine 使用 Python 标准库中的
logging
模块维护您的应用发出的消息以及其他打印到标准错误流中的消息的日志。App Engine 还在日志中记录每个请求。每个日志严重级别(4 表示 CRITICAL,3 表示 ERROR,2 表示 WARNING,1 表示 INFO,0 表示 DEBUG)都有固定的缓冲区大小来控制您可以访问的日志信息量。通常,您在较低日志级别使用日志记录功能越频繁,这些级别的日志事件的时间窗口就越小。
如需浏览过去 90 天的应用日志,您还可以使用 Google Cloud 控制台中的“日志”页面。
请求日志
appcfg
工具现已关停。它的替代产品 Google Cloud CLI 不支持下载日志。但是,您可以使用 gcloud app logs
命令查看日志。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eApp Engine logs application messages from the Python \u003ccode\u003elogging\u003c/code\u003e module and standard error stream, alongside recording each request.\u003c/p\u003e\n"],["\u003cp\u003eLog severity levels have fixed buffer sizes, with lower levels (DEBUG, INFO) typically having a smaller time window for accessible log events.\u003c/p\u003e\n"],["\u003cp\u003eLogs from the last 90 days can be browsed using the Logs page in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eappcfg\u003c/code\u003e tool is shut down, and while the Google Cloud CLI does not support downloading logs, it does allow viewing logs via \u003ccode\u003egcloud app logs\u003c/code\u003e commands.\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.\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/java/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)."]]