Observability for Next.js

Don't let Vercel hide
your Next.js logs.

Vercel's Hobby plan keeps about one hour of runtime logs. FlareLog records every server error from Server Components, Server Actions and Route Handlers, plus client crashes, and keeps them searchable for 7 to 90 days.

npm install @flarelog/sdk

Free up to 25,000 logs/mo · no card needed

Your Next.js app is production-grade. But your logs aren't. By morning the trace is gone.

In production, Next.js replaces server errors with a digest. The real stack trace is in the host's logs, and on Vercel Hobby those are gone after about an hour. FlareLog stores the digest next to the error, so you can paste it in and find the failure.

Setup

One file catches
every server error.

Next.js calls onRequestError in instrumentation.ts for every uncaught server error. FlareLog plugs into that hook, so there is nothing to wrap.

1

Install the SDK

Run npm install @flarelog/sdk. One package covers the server, Route Handlers and React client errors.

2

Set your API key

Add FLARELOG_API_KEY to your Vercel environment variables or .env.local.

3

Add instrumentation.ts

Export onRequestError from createOnRequestError. Server Component, Server Action, Route Handler and middleware errors are now captured with their digest.

4

Add context where you need it (optional)

Wrap a Route Handler with withNextRouteHandler for request logs and traces, and add FlareLogErrorBoundary in a client provider for browser errors. On the Pages Router, use withFlareLog.

instrumentation.ts
import { flarelog } from "@flarelog/sdk";
import { createOnRequestError } from "@flarelog/sdk/next";

const logger = flarelog({ apiKey: process.env.FLARELOG_API_KEY });

// Every uncaught server error: Server Components, Server Actions,
// Route Handlers and middleware. The digest from the error page
// is stored with the stack trace, so you can search for it.
export const onRequestError = createOnRequestError(logger);
.env.local / Vercel dashboard
# Add to your Vercel project
vercel env add FLARELOG_API_KEY

# or paste in the dashboard
FLARELOG_API_KEY=fl_your_api_key
What you get

Errors you can still
find next week

Retention

Days of searchable logs

Stop losing incident context after one hour. FlareLog keeps 7 days on the free tier and 90 days on Pro, so last week's failing Server Action is still searchable.

Search

Query by route, error, or component

Search structured logs by route path, digest, error message, or any field you log. Each error keeps the route type (render, action, route or middleware) that Next.js reports.

Async

No dropped background logs

Background work inside Server Actions, Route Handlers, or waitUntil is flushed before the invocation ends, so it isn't lost when the function freezes.

Predictable pricing

A traffic spike on Product Hunt
shouldn't 10× your logs bill.

Vercel's event-based observability metering scales with every request. FlareLog Pro is a flat $19/mo for up to 1M logs, so bot traffic doesn't turn into a surprise invoice.

Capability
FlareLog logoFlareLog
Vercel Logs
Log retention
7 days free, 90 days on Pro
~1 hour on Hobby; paid plans still limited
Search by App Router / dynamic route
Structured JSON query by path, error, component
Basic text search
Server Action errors
Full error + stack trace retained for days
Generic digest, logs can expire before debug
Async logs (waitUntil, background jobs)
Reliably flushed before invocation ends
Dropped when function freezes
Pricing during traffic spikes
$19/mo Pro flat bucket up to 1M logs
Event-based metering → bill shock
AI-native debugging
MCP server for Cursor / Claude / Lovable
Browser-only workflow

Bot traffic

Scrapers hitting dynamic routes can generate millions of log events. FlareLog's Pro bucket absorbs the noise without multiplying your bill.

Launch day

Product Hunt traffic is a good problem until your logging bill grows with it. A flat rate keeps launch day predictable.

Server Actions gone wrong

A digest string on its own tells you nothing. Search for it in FlareLog to see the stack trace and the context you logged.

AI debugging

Ask your AI why a route
is 500ing in prod.

FlareLog's MCP server connects Cursor, Claude Desktop, or Lovable Agent to your real Next.js logs. Skip the dashboard and let your AI read structured production errors in context.

  • "Show every error in /app/checkout today"
  • "Why did this Server Action fail for user 4829?"
  • "List 500s grouped by route for the last hour"
  • One config block, the same URL and key in every MCP client
Connect MCP server
.cursor/mcp.json
{
  "mcpServers": {
    "flarelog": {
      "url": "https://mcp.flarelog.dev",
      "headers": {
        "Authorization": "Bearer fl_your_api_key"
      }
    }
  }
}

Cursor format. Other MCP clients use the same URL and bearer token.

FAQ

Questions Next.js devs
actually ask

Does it work with the App Router?

Yes. Add onRequestError to instrumentation.ts to capture every server error, and wrap Route Handlers with withNextRouteHandler for request logs. The Pages Router uses withFlareLog.

Will it slow down my API routes or Server Actions?

No. Logs are batched and sent asynchronously out-of-band. Per-request overhead is sub-millisecond, so your TTFB and action latency stay untouched.

Can I see Server Action errors with full context?

Yes. Server Action failures reach FlareLog through onRequestError with the route path, digest and stack trace, plus anything you log yourself. They are kept for 7 days on Free and 90 days on Pro.

What about React client errors?

Use FlareLogErrorBoundary and useFlareLog from @flarelog/sdk/react to send React render and caught errors to the same dashboard.

Do I need a Vercel Pro plan?

No. FlareLog is independent of your Vercel tier. You can stay on Vercel Hobby and still get days of log retention and structured search.

How does pricing work?

Free tier includes 25,000 logs/mo and 7-day retention. Pro is $19/mo for 1M logs/mo and 90-day retention. No surprises during traffic spikes.

Start today

Keep your Next.js errors.
Find the cause behind the digest.

The free tier includes 25,000 logs a month, structured search and client error capture. No credit card and no marketplace integration. Install the SDK and add one file.