Function logs
Netlify provides logs in the Netlify UI to help you observe and troubleshoot serverless functions in your current published deploy, branch deploys, and Deploy Previews.
Access function logs
Section titled “Access function logs”- In the Netlify UI, for your chosen site, go to Logs . Functions
- Select a function from the list to open the log for that function.
By default, the Functions list displays the functions in the current published 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 Developers 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
Section titled “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
Section titled “Date filter”By default, the function log displays a live tail of the latest activity in Real-time. You can also filter to review data from a specific time period, including the Last hour, Last day, Last 7 days, or select Custom to input a specific date and time range.
Text filter
Section titled “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
Log retention and limits
Section titled “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.
Log Drains
Section titled “Log Drains”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.
For logs sent via Log Drains, the output for a single log entry is limited to 700 KB.
Function Metrics
Section titled “Function Metrics”With Function Metrics, you can get insights into the performance, reliability, and usage patterns of functions on your site. By analyzing success and error rates alongside other metrics, such as invocation count and function duration, you can optimize performance, troubleshoot issues, and make data-driven decisions to enhance the overall quality and user experience of your projects.
Did you find this doc useful?
Your feedback helps us improve our docs.