For the complete Netlify documentation index, see llms.txt. Markdown versions of this page are available by appending .md to the URL. 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 in the Netlify UI
Section titled “Access function logs in the Netlify UI”- In the Netlify UI, for your chosen site, go to Logs & Metrics 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:
INFOERRORWARNFATALDEBUGTRACE
Access function logs from the Netlify CLI
Section titled “Access function logs from the Netlify CLI”The Netlify CLI logs command brings function logs into your terminal, either as a live tail or for a historical window. This is useful for quickly debugging without leaving your editor.
netlify logsBy default, the command shows the last 10 minutes of activity from functions and edge functions on the current project. Pass --follow (or -f) to switch to a live tail.
Common options
Section titled “Common options”--follow,-f— stream logs in real time. Cannot be combined with--sinceor--until.--source <type...>,-s— one or more offunctions,edge-functions, ordeploy. Defaults tofunctionsandedge-functions.--function <name...>— limit to specific functions by name. Pass multiple times to include more than one.--edge-function <name...>— limit to specific edge functions by name or path.--since <time>— start of the historical window. Accepts a duration (10m,1h,24h) or an ISO 8601 timestamp.--until <time>— end of the historical window. Defaults to now. Requires--since.--level <levels...>,-l— filter by log level:trace,debug,info,warn,error, orfatal.--url <url>,-u— show logs for the deploy behind a given URL (deploy permalink or branch subdomain).--json— output logs as JSON Lines.
Examples
Section titled “Examples”# Live tail of all function and edge function activitynetlify logs --follow
# Last hour of logs for the "checkout" function onlynetlify logs --function checkout --since 1h
# Errors and fatals across the last 24 hoursnetlify logs --since 24h --level error --level fatal
# JSON Lines output, useful for piping to other toolsnetlify logs --json --since 1hLog 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”On credit-based plans, function metrics are available through Observability, with a dedicated Functions reference covering success and error rates, invocation count, duration, and other indicators you can use to optimize performance, troubleshoot issues, and make data-driven decisions to enhance the overall quality and user experience of your projects.
If you’re on a legacy plan, the same project shows a more limited Function Metrics page instead.
Did you find this doc useful?
Your feedback helps us improve our docs.