【发布时间】:2020-05-04 19:03:45
【问题描述】:
【问题讨论】:
标签: php google-app-engine stackdriver google-cloud-stackdriver google-app-engine-php
【问题讨论】:
标签: php google-app-engine stackdriver google-cloud-stackdriver google-app-engine-php
您应该在 Stackdriver Logging 中拥有所需的数据。正如documentation 中所述:
当向您在 App Engine 中运行的应用发送请求时,请求和响应详细信息会自动记录下来,并且可以在 Google Cloud Console Stackdriver Logging Logs Viewer 中查看。
您只需转到Stackdriver Logging 并匹配报告的错误。然后单击expand,您将看到与有问题的请求相关的所有数据。
您也可以configure the views for the logs,以使它们更多或更少细节,或定义它们的优先级。此外,您可以编写自己的日志,其中包含您想要包含在其中的所有数据:
当您的应用程序处理请求时,它可以将自己的日志消息写入 stdout 和 stderr。使用 stdout 输出和 stderr 错误来编写应用程序日志。这些文件是自动收集的,可以在日志查看器中查看。
【讨论】:
[error] 20#20: *2 FastCGI sent in stderr: "PHP message: PHP Fatal error: ErrorException: Undefined variable: ... 由于“PHP 致命错误”之前的额外文本,堆栈驱动程序不知道这是一个错误它只是显示为标准日志消息。