Skip to content

Vercel & Next.js logging

Keep Next.js production logs past Vercel's 1-day window.

When a customer reports a Friday checkout bug on Monday morning, Vercel's 1-hour Hobby and 1-day Pro runtime logs are already gone. Wire Next.js OpenTelemetry in one prompt to keep structured logs searchable by customer from $20/month.

Native Vercel Runtime Logs vs Libra Logs

Sourced from Vercel's official Runtime Logs and Drains documentation (checked 2026-12-02).

DimensionLibra LogsVercel Runtime Logs
Runtime log retentionIncluded while your workspace plan is active ($20/mo up to 25 GB, $150/mo up to 100 GB)1 hour on Hobby, 1 day on Pro, 3 days on Enterprise (30 days requires Observability Plus)
Search & customer groupingFull structured field search plus automatic grouping by customer, tenant, user email, or org IDFree-text search in the Logs tab is limited to message and requestPath; grouped per HTTP request
Log forwarding on Hobby vs ProNext.js instrumentation.ts OTLP export works on Hobby, Pro, Enterprise, and non-Vercel hostsVercel Drains require a Pro or Enterprise plan
Cross-service backend correlationCorrelates Next.js routes with Supabase/Postgres, Fly.io workers, Heroku, and AWS CloudWatch in one viewCovers Vercel Functions and Routing Middleware only
Coding-agent integrationRead-only MCP server (`whats_broken`, `search_logs`) for Claude Code, Cursor, and CodexCLI and dashboard inspection

One-prompt Next.js install

Add instrumentation.ts without locking into a vendor SDK.

Paste the setup prompt into Claude Code, Cursor, or Codex. It configures standard OpenTelemetry /v1/logs on a reviewable git branch and verifies the first line arrived. If your backend also uses Supabase, Heroku, or AWS CloudWatch, both streams land in the same customer timeline.

When native Vercel Logs is enough

If your entire application lives inside Vercel Functions, you only inspect live deploy errors within 24 hours, or you already pay for Vercel Observability Plus and do not need cross-provider customer grouping, native Vercel Logs covers basic request tailing with zero setup.

Vercel documentation sources (2026-12-02)
  • Vercel: https://vercel.com/docs/logs/runtime (Runtime log retention by plan: Hobby 1 hour, Pro 1 day, Enterprise 3 days, or 30 days with Observability Plus (up to 14 consecutive days viewable); max 256 lines and 1 MB per request; free-text search limited to message and requestPath, read 2026-12-02)
  • Vercel: https://vercel.com/docs/drains (Vercel Drains forward logs and OpenTelemetry traces to custom HTTP endpoints, available on Pro and Enterprise plans, read 2026-12-02)
Paste into Claude Code, Cursor, or CodexCopy prompt
Set up Libra Logs (https://libra.exla.ai) in this repo.

1. First ask whether I want to connect Libra Logs to my coding tools so they can search my logs and read change pages. Explain that this writes an MCP connection to my own global Claude Code or Cursor configuration. Only if I explicitly agree, use `npx -y libra-logs@latest --yes --mcp`; otherwise use `npx -y libra-logs@latest --yes`.
2. Run the selected command from the repo root. It waits for browser approval, so run it in the background or with a timeout of at least 10 minutes. Show me its sign-in link and code right away, then wait while I approve the selected workspace. After approval, the installer automatically obtains workspace-scoped API keys. Do not ask me to create or paste an API key manually.
3. If it says it skipped the AI step, ask whether Libra Logs may send this repo's source files to a model. Only if I say yes, rerun the selected command with `--ai-consent` added. Keep `--mcp` only if I approved that connection separately.
4. When it finishes, tell me the branch it created, what it changed, whether my first log was confirmed, and whether the requested coding-tool connection succeeded. Do not push or open a PR unless I ask.
Or run it yourself: npx libra-logs

FAQ

Vercel & Next.js log retention questions

How long does Vercel retain runtime logs on Hobby, Pro, and Enterprise?

According to Vercel's Runtime Logs documentation, Hobby retains runtime logs for 1 hour, Pro retains them for 1 day, and Enterprise retains them for 3 days unless you purchase the Observability Plus add-on (up to 14 consecutive days viewable within a 30-day window). Exporting OpenTelemetry logs from Next.js to Libra Logs gives persistent customer-searchable logs starting at $20/month.

Do I need a Vercel Pro plan to send Next.js logs to Libra Logs?

No. Vercel Drains require a Pro or Enterprise Vercel team, whereas standard OpenTelemetry export via Next.js instrumentation.ts runs inside your application runtime and works on Vercel Hobby, Vercel Pro, Fly.io, AWS, and local dev alike.

Can Claude Code and Cursor query Next.js production logs through Libra?

Yes. Once Next.js sends OTLP logs to Libra Logs, you connect Libra's read-only HTTP MCP server to Claude Code, Cursor, or Codex so your editor can inspect customer-grouped failures, route status codes, and exact log lines.

Never lose a weekend bug to a 24-hour log cap.

Connect Next.js OpenTelemetry in minutes and see which customers need attention today.

Paying Datadog or Sentry? Send us your bill and we'll beat it.