ScriptsJul 16, 2026·3 min read

pino — Super Fast Node.js Logger

Low-overhead JSON logger for Node.js that uses worker threads for transport, delivering 5x the throughput of alternatives.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
pino Overview
Direct install command
npx -y tokrepo@latest install c22f6ed8-8135-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

pino is a low-overhead JSON logger for Node.js designed for production workloads. It achieves throughput 5x higher than alternatives like Winston and Bunyan by writing structured JSON to stdout and offloading formatting to separate transport processes. This design keeps the event loop free and logging fast.

What pino Does

  • Outputs structured JSON logs to stdout with minimal serialization overhead
  • Supports standard log levels: trace, debug, info, warn, error, fatal
  • Offloads log transport and formatting to worker threads or child processes
  • Provides child loggers that inherit and extend parent context
  • Redacts sensitive fields like passwords and tokens from log output

Architecture Overview

pino writes newline-delimited JSON (NDJSON) to a file descriptor using synchronous writes that bypass the Node.js stream machinery. Formatting, filtering, and delivery to external systems happen in separate transport workers via pino.transport(), which runs in a worker thread with its own event loop. This architecture means logging never blocks the main application thread, even under high throughput.

Setup & Configuration

  • Install via npm install pino and optionally pino-pretty for development formatting
  • Set the log level with pino({ level: 'info' }) or the LOG_LEVEL environment variable
  • Use pino.transport({ target: 'pino-pretty' }) for human-readable dev output
  • Configure redaction with pino({ redact: ['password', 'token'] })
  • Create child loggers with logger.child({ requestId: 'abc' }) for per-request context

Key Features

  • 5x faster than Winston and Bunyan in benchmarks
  • Worker-thread transports keep the event loop unblocked
  • Built-in field redaction for GDPR and security compliance
  • Child loggers with inherited context for request tracing
  • Ecosystem of 50+ community transports (Elasticsearch, Datadog, Loki, file rotation)

Comparison with Similar Tools

  • Winston — pluggable transports in-process, pino offloads transports to workers for better performance
  • Bunyan — JSON-first like pino but slower; Bunyan CLI for viewing, pino uses pino-pretty
  • Loguru (Python) — similar philosophy of simple structured logging but for Python, not Node.js
  • console.log — no structure, no levels, no redaction; pino adds all of these with minimal overhead

FAQ

Q: Why does pino output JSON instead of plain text? A: JSON is machine-parseable, making it easy to ingest into log aggregation systems. Use pino-pretty for human-readable output during development.

Q: How do I send pino logs to Elasticsearch or Datadog? A: Use a transport like pino-elasticsearch or pino-datadog-transport configured via pino.transport().

Q: Can I use pino with Express or Fastify? A: Yes. Fastify uses pino as its default logger. For Express, use pino-http middleware.

Q: Does pino support log rotation? A: Use the pino-roll transport or pipe stdout to a rotation tool like logrotate.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets