By Raj

Part of our Google Apps Script Consulting guides. Need this built for your team? Hire a Google Apps Script developer.

Estimated reading time: 10 minutes

How to Debug Google Apps Script: Logger, Breakpoints & Error Handling

Apps Script debugging is split between the in-browser editor, execution transcripts, and optional Cloud Logging for Workspace admins. Unlike Node, you cannot attach a local debugger unless you use clasp and external tooling for limited scenarios.

Most production bugs are authorization drift, trigger type mistakes, or silent empty ranges—not syntax errors. Your first step is always View > Executions and reproducing with a manual run.

This guide walks Logger.log, breakpoints, try/catch patterns, and status-sheet observability. If triggers never fire, start at /blog/google-apps-script-trigger-not-working-fix.

Execution transcript and failures

Open the Executions panel to see which trigger fired, duration, and stack traces. Failed runs often show "Exception: You do not have permission" when scopes changed.

Re-run the same function manually from the editor while logged in as the user who owns the trigger—usually the installer, not every viewer of the sheet.

Logger.log vs console

Logger.log output appears in the execution log for that run only. Log structured objects with JSON.stringify for UrlFetch responses you need to inspect.

Avoid logging full PII or API keys. Truncate tokens and log response codes instead.

Breakpoints in the IDE

Set breakpoints on lines in the browser editor and run Debug. Breakpoints work for manual runs; they do not attach to time-driven triggers unless you temporarily call the function yourself.

Use conditional breakpoints on loop indices when processing large arrays loaded via getValues().

try/catch and admin alerts

Wrap UrlFetchApp and GmailApp calls in try/catch, then write err.message and err.stack to a Log sheet row with Utilities.formatDate(new Date(), Session.getScriptTimeZone(), 'yyyy-MM-dd HH:mm:ss').

For recurring failures, send a single admin email per day via a counter in Script Properties to avoid email quota storms.

Example code

function debugFetch(url) {
  try {
    const res = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
    Logger.log('HTTP %s body length %s', res.getResponseCode(), res.getContentText().length);
    return res;
  } catch (e) {
    Logger.log('Fetch failed: %s', e.message);
    throw e;
  }
}
ApproachBest forTradeoff
Apps Script nativeGoogle Workspace-centric workflows6-min limit, quotas
Zapier / MakeNo-code, many connectorsPer-task cost, vendor lock-in
Python + CloudHeavy data / MLHosting cost, separate auth
Google Apps Script consultingProduction custom logicBuild cost, you own code

FAQ

Why does my trigger show no logs?

Confirm you are viewing Executions for the correct script project (container-bound vs standalone). Simple triggers do not appear the same way as installable triggers and cannot log UrlFetch results.

Can I debug doGet as a web app?

Use Logger.log and redeploy; logs appear under Executions for the web app deployment. For local iteration, clasp push and test with curl against the deployment URL.

How do I log without exceeding quotas?

Log summaries—row counts, HTTP status codes—not entire payloads. Archive verbose logs to a dedicated Log sheet with weekly pruning.

What is Exception: Service Spreadsheets failed?

Often transient Google infrastructure or an invalid range reference. Log the range A1 notation and retry once with Utilities.sleep(1000) before alerting humans.

Does clasp help debugging?

clasp lets you edit in VS Code and push, but debugging still centers on Executions in the web UI. Pair clasp with git bisect when a deployment regresses—see /blog/apps-script-clasp-guide.

Need this done for you? I handle this as part of my consulting work — fixed-price quote within 24 hours.

Book a call with Raj →

Get the full How to Debug Google Apps Script script template

I'll email you a production-ready, commented version you can deploy in 10 minutes.

Need help with this? I handle this as part of my Google Apps Script Consulting service.

Workflow automation, script audits, triggers, quotas, and production best practices.

See how it works →