Function logs

Selecting a serverless function from the list on your site’s Functions page will open the log for that function.

# Log contents

Netlify displays a log for each serverless function, including:

  • Start of each invocation
  • Any console.log() statements you include in your function code
  • Log statements as each background function is executed

Logs are retained for up to 24 hours, but the history is cleared when there is a new function deployment. A new function deployment happens when a site deploy includes changes to the function code or to the site's environment variables.

# Date filter

By default, the function log displays a live tail of the Latest logs. You can also filter by data from the Last hour, or select Custom to input a specific date and time range.

# Text filter

You can filter the contents of the log with simple text matches on request ID, message, or log level. Some common log levels include:

  • INFO
  • ERROR
  • WARN
  • FATAL
  • DEBUG
  • TRACE

# Branch deploys and Deploy Previews

By default, the Functions list displays the serverless functions in the current production deploy. To find functions on another deploy, you can use the dropdown at the top of the list. You can start typing to jump to a particular branch, or find a Deploy Preview by number.