Runtime Logs on Vercel provide a comprehensive toolset for managing and analyzing logs generated by Serverless and Edge Function invocations. This feature is accessible on all plans, with users having owner, member, or developer roles granted access.
What are Runtime Logs?
Runtime Logs encompass all logs generated during both preview and production deployments. These logs capture information about function output, including console.log outputs, offering insights into the execution of your functions.
Key Features:
Real-time display of logs
Separate log entries for each action, such as console.log
4 KB per line for each log entry
Viewing Runtime Logs
To access and view your runtime logs:
Select the desired project from the dashboard.
Navigate to the Logs tab in your project overview.
Here, you can inspect, search, and filter runtime logs, each row providing essential information about the request, execution, domain, HTTP status, function type, and RequestId.
Log Filters
Use the left sidebar to apply various filters for a refined search experience. Available filters include:
Timeline: Filter logs based on a specific timeline, with options like the past hour, last 3 days, or a custom timespan.
Level: Filter logs by Info, Warning, or Error levels.
Function: Analyze logs for one or more functions defined in your project.
Host: View logs for domains and subdomains attached to your project.
Deployment: Filter logs based on deployment URLs.
Type: Search for logs based on Serverless Functions, Edge Middleware, Edge Functions, or Request types.
Request Method: Filter logs based on the request method, such as GET or POST.
Cache: Filter logs based on cache behavior, like HIT or MISS.
Save Log Presets
Log Presets enable you to save selected filters for future use. Presets can be saved to either My Project Presets (personal account) or Team Project Presets. Note that presets are project-specific.
To save a preset, modify filters in the left sidebar, then click Save and choose the scoping group (Personal or Team).
Search Log Fields
The main search field allows you to filter logs by messages, and you can search filtered values from the main search bar. Supported search fields include Function name, Level type, Log type, Host, Deployment, Request Method, Cache status, Status code, and RequestID.
Log Details
Clicking on a log from the list reveals detailed information in the right sidebar, including log title, timestamp, HTTP status code, domain, Request ID, user agent, level, cache status, log type, function name, location, runtime details (for Serverless Functions), and the log message.
Additional Logs and Sharing
The Show New Logs button loads new log rows based on selected filters. You can share specific log entries by copying the browser's URL and sharing it with team members.
Limits
Logs are streamed with no limit on output frequency.
Each log output can be up to 4 KB; logs exceeding this limit will be truncated.
Retention and log entry limits vary based on the plan (Hobby, Pro, Enterprise).
Effectively utilizing Runtime Logs enhances your debugging and monitoring capabilities, providing valuable insights into your application's behavior. Explore the various filters and functionalities to streamline your development workflow.
For more information and updates, refer to the official documentation and stay connected with the Vercel community. Happy logging!
https://vercel.com/docs/observability/runtime-logs
Overview
Runtime Logs on Vercel provide a comprehensive toolset for managing and analyzing logs generated by Serverless and Edge Function invocations. This feature is accessible on all plans, with users having owner, member, or developer roles granted access.
What are Runtime Logs?
Runtime Logs encompass all logs generated during both preview and production deployments. These logs capture information about function output, including
console.log
outputs, offering insights into the execution of your functions.Key Features:
console.log
Viewing Runtime Logs
To access and view your runtime logs:
Here, you can inspect, search, and filter runtime logs, each row providing essential information about the request, execution, domain, HTTP status, function type, and RequestId.
Log Filters
Use the left sidebar to apply various filters for a refined search experience. Available filters include:
Save Log Presets
Log Presets enable you to save selected filters for future use. Presets can be saved to either My Project Presets (personal account) or Team Project Presets. Note that presets are project-specific.
To save a preset, modify filters in the left sidebar, then click Save and choose the scoping group (Personal or Team).
Search Log Fields
The main search field allows you to filter logs by messages, and you can search filtered values from the main search bar. Supported search fields include Function name, Level type, Log type, Host, Deployment, Request Method, Cache status, Status code, and RequestID.
Log Details
Clicking on a log from the list reveals detailed information in the right sidebar, including log title, timestamp, HTTP status code, domain, Request ID, user agent, level, cache status, log type, function name, location, runtime details (for Serverless Functions), and the log message.
Additional Logs and Sharing
The Show New Logs button loads new log rows based on selected filters. You can share specific log entries by copying the browser's URL and sharing it with team members.
Limits
For detailed observability limits, refer to the Vercel documentation.
Conclusion
Effectively utilizing Runtime Logs enhances your debugging and monitoring capabilities, providing valuable insights into your application's behavior. Explore the various filters and functionalities to streamline your development workflow.
For more information and updates, refer to the official documentation and stay connected with the Vercel community. Happy logging!