在Stackdriver日志记录中未创建任何日志 [英] No logs are created in Stackdriver logging
问题描述
在我的Google应用程序脚本中,我有:
In my google app script, I have:
Logger.log("test");
我什至尝试
console.log("test");
但是,即使我将项目ID设置为Google Cloud Project ID,也都不会打印到堆栈驱动程序日志中.
But neither is printed to the stackdriver log, even after I've set the project id to a Google Cloud Project id.
屏幕显示:
推荐答案
要能够在Stackdriver上查看日志,您的项目应该已链接到默认项目的Google Cloud Standard项目,否则您只能看到"Stackdriver日志"在 https://script.google.com
To being able to see the logs on Stackdriver your project should have linked to a Google Cloud Standard project instad of the default project otherwise you only could see the "Stackdriver logs" on the executions pages in https://script.google.com
来自 https://developers.google.com/apps-script/guides/logging#using_stackdriver_logging
使用Stackdriver Logging
Stackdriver日志已附加到与您的关联的GCP项目中Apps脚本.您可以在以下位置查看这些日志的简化版本:Apps脚本仪表板.充分利用Stackdriver Logging及其功能,请在脚本项目中使用标准的GCP项目.这样,您可以直接在GCP控制台中访问Stackdriver日志,为您提供更多查看和过滤选项.
Using Stackdriver Logging
Stackdriver logs are attached to the GCP project associated with your Apps Script. You can view a simplified version of these logs in the Apps Script dashboard. To make full use of Stackdriver Logging and its capabilities, use a standard GCP project with your script project. This lets you access Stackdriver logs directly in the GCP Console and gives you more viewing and filtering options.
这篇关于在Stackdriver日志记录中未创建任何日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!