Skip to content

View Next.js & Monorepo Local Dev Logs in a Browser UI ​

When next dev, turbo dev, or pnpm -r --parallel dev runs in a single terminal, server-side console.log calls, route handler errors, and API logs interleave until your terminal scrollback overflows. Pipe your dev command into Logdy (npm run dev 2>&1 | logdy --fallthrough) to inspect, search, and filter Next.js server logs in a browser tab at http://127.0.0.1:8080—or use logdy socket + logdy forward to give each monorepo app its own filterable stream in one UI.

Definition: A local dev browser log viewer captures server-side stdout and stderr from frameworks like Next.js, Express, or Fastify and renders them in a local web UI with full-text search, pause/resume, JSON column parsing, and per-service filtering.

Quick Start: Stream next dev Logs to Your Browser ​

Step 1: Install Logdy ​

bash
brew install logdy
# or: curl https://logdy.dev/install.sh | sh

Step 2: Pipe next dev (or Wrap It with logdy stdin) ​

bash
# Option 1: Pipe stdout + stderr and keep printing to your terminal (-t / --fallthrough)
npm run dev 2>&1 | logdy --fallthrough --port 8080

# Option 2: Let Logdy launch the dev command directly
logdy stdin "npm run dev" --fallthrough --port 8080

Open http://127.0.0.1:8080. Next.js route logs, Server Component console.log output, and stack traces stream live—while --fallthrough keeps your terminal output intact so you still see compilation status and the local Next.js URL (http://localhost:3000).

Tip: Add a dev:logs script to package.json so anyone on your team can run it with one command:

json
{
  "scripts": {
    "dev": "next dev",
    "dev:logs": "next dev 2>&1 | logdy --fallthrough --port 8080"
  }
}

Preserving ANSI Colors vs Clean Text ​

By default, Logdy strips terminal ANSI escape sequences so search and JSON parsing stay clean. If you specifically want raw ANSI codes preserved, pass --disable-ansi-code-stripping.

Monorepo Setup: Separate apps/web, apps/api, and Workers in One Tab ​

In a Turborepo, Nx, or pnpm workspace monorepo, piping turbo dev as one stream mixes every workspace together. Instead, start Logdy in multi-port socket mode and forward each app to a dedicated local TCP port:

bash
# Terminal 1: Start Logdy listening on 3 local ports (web, api, worker)
logdy socket 8123 8124 8125 --port 8080

Then forward each workspace's output using logdy forward:

bash
# Terminal 2: Next.js web app -> port 8123
pnpm --filter web dev 2>&1 | logdy forward 8123

# Terminal 3: Backend API -> port 8124
pnpm --filter api dev 2>&1 | logdy forward 8124

# Terminal 4: Background worker -> port 8125
pnpm --filter worker dev 2>&1 | logdy forward 8125

Or wire all of them into a single root package.json command with concurrently:

json
{
  "scripts": {
    "dev:ui": "concurrently \"logdy socket 8123 8124 --port 8080\" \"pnpm --filter web dev 2>&1 | logdy forward 8123\" \"pnpm --filter api dev 2>&1 | logdy forward 8124\""
  }
}

In the Logdy sidebar, each port shows up as a clickable origin facet—so you can mute noisy Next.js HMR messages and inspect only api errors, or view both chronologically to trace a full-stack request.

Structured JSON Logs in Next.js (Pino / Winston) ​

Plain console.log works out of the box in Logdy, but emitting newline-delimited JSON from Next.js Route Handlers and Server Actions unlocks automatic columns and facets (level, route, requestId, userId):

ts
// lib/logger.ts
import pino from "pino";

export const logger = pino({
  level: process.env.LOG_LEVEL ?? "info",
});

When you run next dev 2>&1 | logdy --fallthrough, Logdy parses every JSON line from pino automatically while still displaying Next.js's plain-text compilation lines alongside them.

Bonus: Let Your AI Coding Agent Read Bounded Dev Logs Without Flooding Context ​

If you debug Next.js with Claude Code, Cursor, or Codex, add --append-to-file and --rotate-file-size so you browse live in the browser while your agent inspects only the last N lines of a bounded file on demand:

bash
npm run dev 2>&1 | logdy --fallthrough \
  --append-to-file /tmp/next-dev.log \
  --rotate-file-size 10M \
  --port 8080

Comparing Local Dev Log Workflows ​

ApproachMulti-App FilteringStructured JSON FacetsUnlimited Scrollback SearchCaptures Browser DevTools console.log?
VS Code / Terminal scrollbackNo (split panes only)NoLimited by scrollback bufferNo
Logdy (stdin / socket)Yes (per-port facets)Yes (auto JSON + TS parsers)Yes (up to --max-message-count, default 100k)No (server stdout/stderr; client needs POST /api/log)
Turborepo TUI (turbo dev)Yes (per-task TUI panes)NoTerminal-boundNo
Browser DevTools ConsoleNoObject inspectorCurrent page session onlyYes (client-side only)

Honest Limits of Using Logdy for Next.js Local Dev ​

  • Server-side logs only by default: Logdy captures stdout and stderr from Node.js / Next.js Server Components, Route Handlers, and APIs. Client-side console.log calls in "use client" components still appear in Chrome/Firefox DevTools unless you explicitly forward them to Logdy's POST /api/log endpoint (requires --api-key).
  • Interactive prompts: Piping a command into logdy or running it under logdy stdin is designed for non-interactive log streams. Avoid piping commands that wait for interactive keyboard prompts.
  • In-memory session buffer: Logdy holds the latest 100,000 lines in memory by default (--max-message-count). Restarting Logdy clears the view unless you also write to disk with --append-to-file.

FAQ ​

Why do I need 2>&1 when piping npm run dev to Logdy? ​

Unix pipes (|) only forward stdout by default, while Next.js and Node.js write many errors and warnings to stderr. Adding 2>&1 merges stderr into stdout so Logdy receives both normal logs and stack traces.

Will piping next dev into Logdy hide output from my terminal? ​

Not if you pass --fallthrough (-t). With npm run dev 2>&1 | logdy --fallthrough, every line is still printed to your terminal while also streaming to http://127.0.0.1:8080.

What if port 8080 is already used by another local service? ​

Pass --port (-p) or set LOGDY_PORT, for example npm run dev 2>&1 | logdy --port 8099 --fallthrough.

Can Logdy handle both plain-text Next.js lines and Pino JSON logs in the same stream? ​

Yes. Logdy parses valid JSON lines into structured fields and renders plain-text lines cleanly in the same chronological table.

Does Logdy work with Vite, Remix, Nuxt, Django, Rails, or Laravel dev servers? ​

Yes. Because Logdy reads any stdout/stderr pipe or log file (logdy follow storage/logs/laravel.log), the exact same pattern works with vite, rails server, python manage.py runserver, and php artisan serve.


Related guides: VS Code View Terminal Logs · AI Coding Agent Skills for Live Log Debugging · Local JSON Log Viewer