Writes a message to the execution log.
class Logger method .log()
Logger is the Apps Script service.
.log() is the method name you will see after a dot in your code.
What it does
Why it's used
- Leave breadcrumbs while debugging a tricky trigger.
- See values in Executions when something fails in production.
Common errors
- Forgetting parentheses on log. Write Logger.log(), not Logger.log or log by itself.
- Skipping dots between chained calls. Each step needs a dot, like Logger.log().
- Adding spaces where they do not belong. Write Logger.log(), not Logger .log(), Logger.log (), or Logger . log().
- Wrong capitalization. Use Logger and log, not logger or log.
Snippets using this method
- Basic CRM - Add a Powerful Script To Move Row Based on Status
- Automatically Backup a Spreadsheet
- Automate Form Response to Confirmation Email
- Automate Google Sheets With Zero Experience
- Automate Help Desk Ticket Closing
- Add Tasks to Google Tasks From Google Sheets
- Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
- 2 New Ways To Add Emoji Reactions
Explore
Related methods
More Apps Script
Better Sheets tutorials
2 New Ways To Add Emoji Reactions
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
Add Tasks to Google Tasks From Google Sheets
Automate Form Response to Confirmation Email
Automate Google Sheets With Zero Experience
Automatically Backup a Spreadsheet
Basic CRM - Add a Powerful Script To Move Row Based on Status
Related blog posts
Written guides about Logger.log().
Learn to Code in Google Sheets, For Programmers | For Advanced Google Sheet Users
If you know how to code, you'll learn in this step-by-step tutorial how to code in Google Sheets.
Read post →How to Send Google Forms Entries Automatically with Apps Script
Google Forms provides basic email notifications for form submissions, but enhancing these notifications with detailed summaries can significantly improve productivity and response management.
Read post →