Explore documentation
Vercel Better Stack integration
Start logging in 2 minutes
Automatically collect logs from your Vercel projects:
- Go to Vercel Better Stack integration.
- Click
Add integrationand follow the simple steps there. - You should see your logs in Better Stack β Live tail.
- Check out your metrics in the Vercel dashboard.
Choose which logs Vercel sends
Send only the logs you need to lower your Vercel drain usage and the data you ingest:
- Open your Vercel source in Sources. It opens on Ingest.
- Under Vercel log drain, select the Log sources and Environments to send, and set Sampling of logs to the percentage of requests to send.
- Click Save changes. We'll update the project's log drain in Vercel a few minutes later without dropping logs.
Having trouble applying the options?
Older installations have to accept the integration's updated permissions first. Click Open Vercel integrations in the warning, select Manage next to Better Stack, accept the permissions, then save the page again.
Optional structured logging
Take advantage of full-stack structured logging in 3 steps.
1. Install
Install Better Stack Next.js NPM package:
2. Setup
Set up Better Stack Next.js client in next.config.js:
Import Better Stack Next.js logger:
3. Start logging
Use structured logging in client, edge, or server-side files:
You should see your logs in Better Stack β Live tail.
Next.js version 12.1.4 or higher is required
Need help?
Please let us know at hello@betterstack.com.
We're happy to help! π
Advanced usage
Web Vitals
Forward Web Vitals metrics provided by Vercel to Better Stack.
Set up metrics reporting in pages/_app.js:
Handlers
Get logger with automatic log flushing and built-in exception logging.
Wrap your Next.js route handlers with Better Stack:
Log levels
Better Stack Next.js client provides four log levels: debug, info, warn, and error.
Stop sending debug logs to Better Stack:
Server-side props
Take advantage of automatic log flushing and built-in exception logging.
Wrap your server-side props with Better Stack: