Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Apps Script logs (web app) don't show up in the new interface

Apps Script has recently moved the StackDriver logs into the Apps Script dashboard, page 'Execution'.

Problem is, the logs won't show up in the dashboard for Apps Script web apps. I can see the new execution line when I do a request to the Apps Script web app, but the line won't expand to show the logs.

I'm using the Stackdriver Logging:

function doPost(e) {
  console.info('my log');
}

Curiously, it works when I call the dev url (Deployment column is tagged as 'Head'), the line does expend when I click on it and I can see the logs, but for the exact same application it does not work when I call the production url ending with /exec (Deployment column is tagged as 'Version 2').

Also, it works with GET requests, but not with POST requests.

The web app is deployed with the permissions below:

  • Execute the app as 'Me'
  • Who can access to the app: anyone, even anonymous
  • Drive sharing settings: only specific people can access

enter image description here

Is it a bug in their new interface or am I missing something?

like image 680
lordofmax Avatar asked Jun 03 '19 18:06

lordofmax


People also ask

How do I view the script log in Google Apps?

A basic approach to logging in Apps Script is to use the built-in execution log. To view these logs, at the top of the editor, click Execution log.

Why is Google script not working?

There are a few possible causes for these errors: A Google server or system is temporarily unavailable. Wait for a few moments and try running the script again. There is an error in your script that doesn't have a corresponding error message.


1 Answers

I was able to work around this issue by creating a Cloud Console project at https://console.cloud.google.com and associating the Apps Script with that new project.

After jumping through the required hoops of setting up an OAuth Consent screen and re-authorizing the script, I am able to see logs from anonymous requests in the logging section of the Cloud Console.

like image 66
Cameron Roberts Avatar answered Nov 16 '22 02:11

Cameron Roberts