structured-logging
Installation
SKILL.md
Structured Logging Skill
Structured logging with Pino for Next.js. This file holds the rules; setup and worked code are in the references.
- references/log-levels.md - When to use each level
- references/patterns.md - Common logging patterns (DB ops, server actions, error logging)
- references/examples.md - Practical examples and the full
lib/logger.tssetup
Setup
The logger is configured once in lib/logger.ts (Pino + pino-pretty in dev, JSON in prod) and
exposes createLogger(context) for per-module child loggers. Full config in
references/examples.md.
import logger, { createLogger } from "~/lib/logger";
logger.info({ port: 3000 }, "Server started");