Logger.log extremely slow

279 views
Skip to first unread message

Ricardo de Vries

unread,
Mar 19, 2020, 12:35:11 PM3/19/20
to Google Apps Script Community
Hi there,

I've written some scripts, and now since the new runtime engine, it seems that Logger.log() is just extremely slow. When I want to log something, it just doesn't appear in the logs. Only when I log a number or something very simple.

Anyone experiencing the same problem?

Alan Wells

unread,
Mar 19, 2020, 12:40:19 PM3/19/20
to Google Apps Script Community
The Apps Script people know about the issue, and there are plans to rectify that problem.  In the meantime, you can log to a spreadsheet, or to Stackdriver, or revert back to
  "runtimeVersion": "DEPRECATED_ES5"

There are various people who have created code for logging to a spreadsheet.  Depending upon your preference, you can try an alternative to Logger.log().  You can also go to your Executions in your Apps Script dashboard and see the logs through your Executions which is faster.
There are some existing posts here about the subject.  You could try doing a search.

Andrew Roberts

unread,
Mar 20, 2020, 5:20:26 AM3/20/20
to google-apps-sc...@googlegroups.com
Personally I've been developing in Rhino, and then switching to V8 for production and any performance gains.


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/3d3f5975-4b40-431f-9bee-decdca08edd2%40googlegroups.com.

Bruce Mcpherson

unread,
Mar 20, 2020, 5:51:48 AM3/20/20
to google-apps-sc...@googlegroups.com
I've  no evidence for this, but I suspect that v8 logger is probably using Stackdriver behind the scenes, then retrieving the result when you look at it. 

If so, you may as well use console.log (or divert Logger to console)  the logging is better anyway.

Adam Morris

unread,
Mar 20, 2020, 5:55:29 AM3/20/20
to Google Apps Script Community
I'm using my library as a workaround.

It also provides logging details such as stacktrace and location of Logger.log statement.

Andrew Roberts

unread,
Mar 20, 2020, 5:56:02 AM3/20/20
to google-apps-sc...@googlegroups.com
I think I remember EricK confirming it was something like that.

Andrew Roberts

unread,
Mar 20, 2020, 6:08:03 AM3/20/20
to google-apps-sc...@googlegroups.com
And there is also BBLog for persistant logging to GSheet, StackDriver and/or Firebase.

DISCLAIMER:
This e-mail and the attachment is intended solely for the person to whom they are addressed and may be confidential and privileged. If you are not the intended recipient, you are notified that disclosing, distributing, copying or taking any action in reliance on the contents of this information is strictly prohibited. Please notify the sender immediately if you have received this email and delete it from your system. The recipient should check the email and any attachments for the presence of viruses that could be transmitted via email. Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, incomplete or contain viruses. Detik Harapan Sdn. Bhd. accepts no liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Opinions, conclusions and other information in this email that does not relate to Detik Harapan Sdn. Bhd.'s official business shall be understood as neither given nor endorsed by Detik Harapan Sdn. Bhd.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Adam Morris

unread,
Mar 20, 2020, 10:07:26 PM3/20/20
to Google Apps Script Community
Issue tracker here says they aren't going to fix it, marked as "infeasible"

Maybe there's a new IDE on the way making it moot?

Andrew Apell

unread,
Mar 21, 2020, 8:59:46 AM3/21/20
to Google Apps Script Community
I think they said this is expected behaviour because it is using stackdriver or something like that, The new IDE is supposed to return it to normal.
Reply all
Reply to author
Forward
0 new messages