Function logs

Netlify provides logs to help you observe and troubleshoot serverless functions in your current production deploy, branch deploys, and Deploy Previews.

# Access function logs

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

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

Team Owners and Collaborators can monitor the function logs for a specific deploy by going to the Function logs tab of the Netlify Drawer in a collaborative Deploy Preview.

# Log contents

Netlify displays a log for each function, including:

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

Note that function log retention limits apply and may impact what the Netlify UI displays.

# 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
  • WARN

# Log retention and limits

Logs are retained for at least 24 hours of function activity, even after a new function deployment. This log retention period increases to 7 days for certain pricing plans.

Historical function log output is limited to 4 KB total per invocation. If a log’s output exceeds 4 KB, only the last 4 KB of the log is retained and the log message will be truncated.

# Log Drains

This feature may not be available on all plans.

You can connect your function logs to third-party monitoring services for analysis using Netlify’s Log Drains feature. Check out our Log Drains doc for more information.