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 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
- Select NDJSON for Delivery format.
- Enter
https://pub.observability.app.launchdarkly.com/vercel/v1/logsin the Endpoint field.
- 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:- Open the Telemetry section and navigate to the Logs list.
- Search 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. |