ThomPoppins / blog

https://un-sheeple.me
1 stars 0 forks source link

Learn about Vercel runtime logs #34

Open ThomPoppins opened 8 months ago

ThomPoppins commented 8 months ago

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:

Viewing Runtime Logs

To access and view your runtime logs:

  1. Select the desired project from the dashboard.
  2. 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.

Layout to visualize the runtime logs

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).

Layout to save log presets

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!