Logging with Google Apps script

纵饮孤独 提交于 2019-12-10 22:38:17

问题


I have two questions regarding logging with apps script:

1/ I have two .gs files (in the same project). One (F1) is calling the other (F2) via urlfetch (POST request). The Logger.log works just fine in F1, but doesn't in F2 (maybe it works too, but I just can't retrieve the logs). Do you know if it's normal or where can I find the logs of F2 ?
(If you're wondering, it's made this way so we can call the same function multiple times in parallel).

2/ My scripts are linked to a Google Cloud project and so I've seen we can retrieve some logs via Stackdriver. What logs ? Because those with Logger.log don't seem to be visible from there.

Thanks for your help


回答1:


Regarding your second question: Stackdriver Logging with Apps Script is a new feature, only accessible to G Suite Business customers that applied for early access. The following functions should work

console.log([data][,...])
console.info([data][,...])
console.warn([data][,...])
console.error([data][,...])
console.time([label])


来源:https://stackoverflow.com/questions/42696033/logging-with-google-apps-script

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