Vercel log drain
Vercel keeps runtime logs for a short time. A log drain sends every line as it happens to a place where you can search it, alert on it and keep it. Flowhawk reads Vercel's NDJSON drain format directly.
What you get
- Vercel logs in Logs, next to your traces and metrics, searchable with the same query language (
severity>=WARN service=checkout "timeout"), grouped into patterns or followed live. - A log line that names a request path joins the business flow of that route, so a failing checkout shows its platform logs on the checkout flow's page.
- A line that carries a trace id opens its trace.
- Alert on any search with Alert on this, and let the agent read these logs when it investigates an incident.
Set it up
First create an ingest key: in the app, open Settings > API keys and pick Services. In the examples below, KEY stands for that key. Keep it out of your repository, like any other secret.
- In Vercel, open Team Settings > Drains > Add drain. Choose the type Logs and the format NDJSON.
- Paste this URL as the endpoint. Vercel shows a verification code when you add a drain: put it where the URL says
CODE. Flowhawk sends it back, which is how Vercel checks the endpoint.https://api.flowhawk.dev/v1/logs/vercel?verify=CODE - Add the custom header
Authorization: Bearer KEY. - Pick the projects to drain and save.
The same steps, with your workspace's address filled in, are in the app under Settings > Integrations > Log drains.
What arrives
| Vercel field | In Flowhawk |
|---|---|
projectName | The service name, so each project is its own service |
message | The log line. A request with no message reads as GET /api/checkout 500 |
proxy.method, proxy.path | Used to find the flow and step the request belongs to |
proxy.statusCode, type | The level: 5xx is an error, stderr a warning, the rest info, unless the line has a level of its own |
If your functions log JSON lines, their fields (level, trace id, your own attributes) are read too.
Common questions
Which Vercel plans have log drains?
Vercel offers drains on its paid team plans. Check your plan's limits in Vercel.
Can I get traces from my Next.js app too?
Yes. Add OpenTelemetry with @vercel/otel (OpenTelemetry for Next.js). Logs that carry the trace id then open the request's trace.
How long are the logs kept?
30 days. To keep them longer, Flowhawk can copy every hour of logs to your own S3 bucket (Log drains and archive).