Skip to main content
General

Observability

Monitor your application's performance and track errors with Sentry and Vercel Analytics.

Open MarkdownFull AI corpusFeedback

The Pro Next.js Prisma starter kit includes structured logging and optional integrations for error, traffic and performance monitoring. External services still require your own accounts and project configuration.

Structured Logging

The kit includes a high-performance logging system based on Pino.

Usage

Use the logger to record events with structured metadata.

lib/actions/billing.ts
import { logger } from '@/lib/logger';

logger.info({ userId, amount }, 'Payment processed successfully');

Log Levels

You can control the verbosity of logs via the NEXT_PUBLIC_LOG_LEVEL environment variable.

.env
NEXT_PUBLIC_LOG_LEVEL="debug" # trace, debug, info, warn, error, fatal

Available log levels (from most to least verbose):

  • trace - Very detailed debugging information
  • debug - Debug information
  • info - General informational messages (default)
  • warn - Warning messages
  • error - Error messages
  • fatal - Critical errors