No logs are created in Stackdriver logging

最后都变了- 提交于 2021-02-05 07:17:06

问题


In my google app script, I have:

Logger.log("test");

and I even tried

console.log("test");

But neither is printed to the stackdriver log, even after I've set the project id to a Google Cloud Project id.

The screen shows:


回答1:


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

From https://developers.google.com/apps-script/guides/logging#using_stackdriver_logging

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.



来源:https://stackoverflow.com/questions/62010980/no-logs-are-created-in-stackdriver-logging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!