简体   繁体   English

如何在 App Engine 标准环境 (Node.js) 中设置 Google Cloud 错误报告?

[英]How to setup Google Cloud Error Reporting in App Engine standard environment (Node.js)?

In the docs it says文档中它说

Note: Error logs written to stderr are processed automatically by Error Reporting, without needing to use the Error Reporting library for Node.js directly.注意:写入 stderr 的错误日志由错误报告自动处理,无需直接使用 Node.js 的错误报告库。

Thus, I my application (Node.js 14, App Engine standard environment) logs errors to stderr and I can see them at Google Cloud Logging dashboard.因此,我的应用程序(Node.js 14,App Engine 标准环境)将错误记录到stderr ,我可以在 Google Cloud Logging 仪表板中看到它们。

在此处输入图像描述

// Error Object
{
  "insertId": "60b9efa000007121b8631531",
  "jsonPayload": {
    "type": "Error",
    "pid": 10,
    "level": 50,
    "stack": "Error: test\n    at Object.<anonymous> (/workspace/dist/utils/logger.js:39:22)\n    at Module._compile (internal/modules/cjs/loader.js:1068:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)\n    at Module.load (internal/modules/cjs/loader.js:933:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:774:14)\n    at Module.require (internal/modules/cjs/loader.js:957:19)\n    at require (internal/modules/cjs/helpers.js:88:18)\n    at Object.<anonymous> (/workspace/dist/routes/product-category/edit.js:8:18)\n    at Module._compile (internal/modules/cjs/loader.js:1068:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)",
    "message": "o noo",
    "time": 1622798240028,
    "hostname": "localhost"
  },
  "resource": {
    "type": "gae_app",
    "labels": {
      "project_id": "xxx",
      "zone": "us17",
      "module_id": "default",
      "version_id": "20210604t091336"
    }
  },
  "timestamp": "2021-06-04T09:17:20.028961Z",
  "severity": "ERROR",
  "labels": {
    "clone_id": "00c61b117c4c0ddc91320383c7a1462a90cff4d4f94ba3ec8a2e77217475dd58d4a633941d95a17ff0c2889faffc45f43561f51fad7d5a16bd1e38a1fba05e65fc70fdd43ec7"
  },
  "logName": "projects/xxx/logs/stderr",
  "receiveTimestamp": "2021-06-04T09:17:20.046939477Z"
}

But this is not being reported in Google Cloud Error Reporting dashboard ( dashboard ).但这并没有在Google Cloud 错误报告仪表板( 仪表板)中报告。

I thought App Engine stderr will be automatically utilized by the Error Reporter.我认为错误报告器会自动使用 App Engine stderr错误。

The comment you referred to is under the section for 'App Engine Flexible Environment' and you are working in App Engine Standard Env.您提到的评论位于“App Engine 灵活环境”部分下,并且您正在使用 App Engine 标准环境。 That document says - You can configure Error Reporting for Node.js on the following Google Cloud environments - and App Engine standard is not listed.该文档说 - 您可以在以下 Google Cloud 环境中为 Node.js 配置错误报告 - 并且未列出 App Engine 标准。 Thus it is possible the API is not supported for standard or you have to explicitly configure it for standard因此,标准可能不支持 API,或者您必须为标准显式配置它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 App Engine node.js标准环境下如何下载json文件到云存储 - How to download json file to cloud storage on app engine node.js standard environment 在Compute Engine上连接Redis时,Google Cloud App Engine标准环境节点JS连接超时 - Google Cloud App Engine Standard Environment Node JS connection timeout when connecting Redis on Compute Engine 如何在 Google Cloud App Engine for Node.js 中使用 Memcache - How to use Memcache in Google Cloud App Engine for Node.js 无法从 App Engine Node JS 标准环境连接 Google Cloud MySQL 实例 - Not able to connect Google Cloud MySQL Instance from App Engine Node JS standard environment 无法将Node.js应用程序部署到Google Cloud App Engine - Unable to deploy node.js app to google cloud app engine 为 Google Cloud App Engine 灵活指定 Node.js 版本 - Specifying Node.js version for Google Cloud App Engine Flexible App Engine Standard中的Node.JS如何处理崩溃? - How does Node.JS in App Engine Standard handle crashes? 如何保留部署在谷歌云应用引擎上的 node.js 应用的统计数据并保持我的数据持久化 - How to keep stats for a node.js app deployed on google cloud app engine and keep my data persistent 将Google Cloud App Engine上的Node.js应用程序连接到Google Cloud SQL实例 - Connecting Node.js app on Google Cloud App Engine to a Google Cloud SQL instance 如何在 Google App Engine 标准环境中使用 Google Cloud Build 或其他方法设置环境变量? - How to set environment variables using Google Cloud Build or other method in Google App Engine Standard Environment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM