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

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

  1. Install the package.
    npm install ezlogs-nextjs
  2. Start the agent in instrumentation.ts at your project root (or in src/).
    import { ezlogs } from "ezlogs-nextjs";
    
    export async function register() {
      if (process.env.NEXT_RUNTIME === "nodejs") {
        ezlogs.init({
          projectToken: process.env.EZLOGS_PROJECT_TOKEN!,
        });
      }
    }
  3. 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);
  4. Add your key to .env.local and restart the dev server. The terminal shows [ezlogs] capturing → app.ezlogs.io.
    EZLOGS_PROJECT_TOKEN=ezl_your_api_key_here
  5. Capture database changes (Postgres, Supabase included): which record, each column before and after, and who changed it. Set DATABASE_URL, then run once:
    npm i pg
    npx ezlogs-nextjs install-triggers
    That is all for supabase-js, Drizzle on node-postgres and raw pg. Prisma and postgres.js also need a one-line wrapper (see the README).
  6. 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

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

Supported versions

Next.js 14+ (App Router and Pages Router). Node 18.17+. Postgres 13+ for trigger-based DB capture.

Start free →

No card required · Read-only by design

← Back to home