[英]How to setup Google Cloud Error Reporting in App Engine standard environment (Node.js)?
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.