EZLogs for Next.js
Activity logs for Next.js — App Router, Server Actions, Postgres.
EZLogs is a Next.js activity log that captures every HTTP route and Server Action on its own and, after a short setup, every Postgres change and background job, then correlates them into one plain-English card per customer (or agent) action. Anyone on your team can read it — no log files, no grepping, no engineers needed.
What gets captured
- HTTP routes (App Router + Pages Router) — method, path, status, duration, requesting user if your app exposes one.
- Server Actions — the action name, arguments, success or failure.
- Page views — page loads, via your
middleware.ts/proxy.ts. - Postgres changes after one command,
npx ezlogs-nextjs install-triggers— table, operation, before/after column values with sensitive columns removed. Works with supabase-js, Drizzle and rawpgas is; Prisma and postgres.js need a one-line wrapper. - Background jobs: BullMQ and Upstash Workflow / QStash on their own; Inngest v4 too; Inngest v3, Trigger.dev and Supabase Queues with a short addition.
- Calls to outside services (Stripe, Resend, OpenAI and others) as steps of the action that made them — the service, method, path pattern, status and time. Never a body, a query string or a header.
Install: paste the prompt into your coding AI, or do it by hand
1. Fastest: let your coding AI do it
Paste this into Cursor, Claude Code, v0, Replit or any coding AI. It does every step below, including database changes and jobs, then checks that capture works. It asks you for your API key (Install & keys, the menu behind your initials, top right, after you sign up).
Install EZLogs in this app by following https://app.ezlogs.io/install/nextjs.md
2. By hand
- Install the package.
npm install ezlogs-nextjs - Start the agent in
instrumentation.tsat your project root (or insrc/).import { ezlogs } from "ezlogs-nextjs"; export async function register() { if (process.env.NEXT_RUNTIME === "nodejs") { ezlogs.init({ projectToken: process.env.EZLOGS_PROJECT_TOKEN!, }); } } - Wrap your Next config so routes and Server Actions are captured on their own.
// next.config.ts (or next.config.mjs) import { withEzlogsConfig } from "ezlogs-nextjs/plugin"; const nextConfig = { /* your options */ }; export default withEzlogsConfig(nextConfig); - Add your key to
.env.localand restart the dev server. The terminal shows[ezlogs] capturing → app.ezlogs.io.EZLOGS_PROJECT_TOKEN=ezl_your_api_key_here - Capture database changes (Postgres, Supabase included): which record, each column before and after, and who changed it. Set
DATABASE_URL, then run once:
That is all for supabase-js, Drizzle on node-postgres and rawnpm i pg npx ezlogs-nextjs install-triggerspg. Prisma and postgres.js also need a one-line wrapper (see the README). - Background jobs, if you have them: BullMQ and Upstash Workflow / QStash need nothing more (the config wrapper instruments them where your code imports them); Inngest v4 too; Inngest v3, Trigger.dev and Supabase Queues need a short addition. Snippets.
Works with Turbopack and Webpack, App Router and Pages Router. Every option is in the README.
Works with your stack
- ORMs / DB clients: Prisma, Drizzle, supabase-js, raw
pg. - Background-job runners: BullMQ, Upstash Workflow / QStash, Inngest, Trigger.dev, Supabase Queues.
- Auth: NextAuth / Auth.js (we read
session.user.id), Clerk, Supabase Auth, custom JWT. - Hosting: Vercel, or anywhere Next.js runs on Node.
How is this different from Sentry or Datadog?
Those tools answer “is the system healthy?” with errors, traces, and metrics aimed at engineers debugging. EZLogs answers “what happened to my customer?” with business-level actions aimed at the whole company. They monitor the infrastructure. We explain the work. All the ways to add an activity log to Next.js, compared →
Performance and safety
- Edge-compatible: works in Edge runtime + Node runtime.
- Out-of-band: events buffered in memory, shipped asynchronously.
- Fails open: if EZLogs is unreachable, the agent buffers and retries. The agent never throws into your request path.
- Field-level redaction on by default: parameters named like passwords, tokens, secrets, API keys or card numbers are sent as
[FILTERED], and sensitive columns are removed by the trigger before anything is sent. Phone numbers, addresses, birth dates and IP addresses are never stored: EZLogs keeps that one changed (“changed the phone”), never the value. - Open source at github.com/dezsirazvan/ez_logs_agent_nextjs.
Supported versions
Next.js 14+ (App Router and Pages Router). Node 18.17+. Postgres 13+ for trigger-based DB capture.
No card required · Read-only by design