Skip to content
Last updated on March 1, 2023
6 min read

Runtime Logs

Learn how to search, inspect, and share your runtime logs with the Logs tab.

The Logs tab allows you to view, search, inspect, and share your runtime logs without any third-party integration. You can also filter and group your runtime logs based on the relevant fields.

Note: You can only view runtime logs from the Logs tab. build logs can be accessed from the production deployment tile.

Runtime logs include all logs generated by Serverless and Edge Function invocations. These log results provide information about the output for your functions as well as the console.log output.

You can use the Logs tab to debug and analyze the information provided by the logs.

To view runtime logs, click the Logs tab from your project overview in the dashboard. From here you can view, filter, and search through the runtime logs. Each log row shares basic info about the request like execution, domain name, HTTP status, function type, and RequestId.

You can view runtime logs for both preview and production deployments.

Layout to visualize the runtime logs.
Layout to visualize the runtime logs.
Layout to visualize the runtime logs.

You can use the following filters from the left sidebar to get a refined search experience.

You can filter runtime logs based on a specific timeline. It can vary from the past hour, last 3 days, or a custom timespan depending on your account type. You can use the Live mode option to follow the logs in real-time.

Layout to visualize the runtime logs in live mode.
Layout to visualize the runtime logs in live mode.
Layout to visualize the runtime logs in live mode.
Note: All displayed dates and times are in UTC.

You can filter runtime logs by three kinds of levels: Info, Warning, and Error.

  • Serverless and Edge logs with an output stdout are marked as Info (for example, console.log)
  • Serverless and Edge logs with an output stderr are marked as Error (for example, console.error)
  • Requests with a status code of 4xx are considered a Warning
  • Requests with a status code of 5xx are considered Error
  • All other requests are considered Info

These levels are highlighted with different colors for example, yellow for warnings and red for errors. This color coding is beneficial with debugging; you can identify the failed requests and the reason behind the failure.

You can filter and analyze logs for one or more functions defined in your project. The log output is generated for the Serverless Functions, Edge Functions, and Edge Middleware.

You can view logs for one or more domains and subdomains attached to your team’s project. Alternatively, you can use the Search hosts... field to navigate to the desired host.

Like host and functions, you can filter your logs based on deployments URLs.

Using the type filter, you can search for four logs types generated as a result of:

Logs generated from your Serverless Functions invocations. Log details include additional runtime Request Id details and other basic info
Logs generated as a result of your Edge Middleware invocations
Logs requests generated from your Edge Functions. Log info includes time, domain, and the request method
Logs generated from either ISR or external redirections

You can use the main search field to filter logs by their messages. In the current search state, filtered log results are sorted chronologically, with the most recent first. Filtered values can also be searched from the main search bar.

Note: This free text search feature is limited to the message field. Other fields can be filtered using the left sidebar or the filters in the search bar.

You can view details for each generated runtime log to analyze and improve your debugging experience. When you click a log from the list, the following details appear in the right sidebar:

Log Name
Title of the log generated
Timestamp at which the log was recorded in UTC
Status Code
HTTP status code for the log message
Name of the domain or subdomain for which the log was generated
Request Id
Unique identifier of request created only for runtime logs
Request User Agent
Name of the browser from which the request originated
The level type for example, Info, Warning, or Error
Cache status with values MISS, HIT, STALE, BYPASS, PRERENDER or REVALIDATED status
The function name defined in your /pages/api folder
The geographical region for Serverless and Edge Functions access
Name of the JavaScript runtime environment for Node.js (info only applies to Serverless Function type)
Time duration for the log record result (info only applies to Serverless Function type)
Memory used/Limit
The size of memory that was consumed by the function (info only applies to Serverless Function type)
Function Size
The size of the Serverless Function
Log Message
A detailed log message with additional details for RequestId, Billed Duration, Max Memory Used, etc.

Towards the end of the log results window is a button called Show New Logs. By default, it is set to display log results for the past 30 minutes.

Click this button, and it loads new log rows. The latest entries are added based on the selected filters.

You can share a log entry with other team members to view the particular log and context you are looking at. Click on the log you want to share, copy the current URL of your browser, and send it to team members via the medium of your choice.

Unlike build logs that are stored indefinitely for each deployment, runtime logs are stored for the following limits:

Retention time
Log entries
1 hour of logs
4000 rows of log data
1 hour of logs
4000 rows of log data
3 days of logs
Up to 60 million rows of log data
Note: If you exceed the log entry limits, you can only query recent logs.