Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This topic explains how to send logs from Vercel to LaunchDarkly’s observability features. If you deploy your applications on Vercel, you can configure a log drain to automatically forward your server-side logs to LaunchDarkly. This includes build logs, serverless function logs, edge function logs, and static access logs. Once configured, these logs appear in the Logs page of the LaunchDarkly user interface.Prerequisites
Before you configure the Vercel log drain, you must:- Have a Vercel account with at least one project
- Have LaunchDarkly observability enabled for your project
- Know your LaunchDarkly client-side IDTo find your client-side ID:
- In the LaunchDarkly UI, click the project dropdown to open the project menu.
- Select Project settings.
- Click Environments.
- Find the environment you want to use and copy the Client-side ID value.
Configure the Vercel log drain
You can configure the log drain directly in the Vercel dashboard. To configure the Vercel log drain:- In Vercel, navigate to your team or account Settings.
- Click Log Drains in the sidebar.
- Click Add Log Drain.
- Select the Projects and Environments you want to collect logs from.
- Select Sources to specify which types of logs to send. You can choose from:
- Build logs
- Edge function logs
- Lambda (serverless function) logs
- Static access logs
- For Delivery format, select NDJSON.
- For Endpoint, enter
https://pub.observability.app.launchdarkly.com/vercel/v1/logs. - Click Add Custom Headers.
- Add a header with the name
x-highlight-projectand set the value to your LaunchDarkly client-side ID. - Click Verify to test the connection.
- Click Create Log Drain to save the configuration.
Verify that logs are being received
After you configure the log drain, Vercel begins forwarding logs to LaunchDarkly. To verify that your logs are being received:- In the LaunchDarkly UI, expand Observe in the left navigation.
- Click Logs.
- Look for logs with
source:vercelor from your Vercel-deployed services.
Search attributes
Logs from Vercel include the following attributes that you can use when searching: | Attribute| Description |
|---|
vercel.source
| The source of the log, such as lambda , edge , build , or static . |
| vercel.projectId
| The Vercel project ID. |
| vercel.deploymentId
| The Vercel deployment ID. |
| vercel.host
| The hostname that served the request. |
| vercel.path
| The request path. |
| vercel.statusCode
| The HTTP status code of the response. |
To learn more about searching for logs, read Search specification.