🛠️
Utility5M+/wkMIT

pino

Pino is an extremely fast Node.js logger that outputs newline-delimited JSON (NDJSON) with minimal overhead. Pino achieves 5-10x higher logging throughput than

Installation

npm
npm install pino
yarn
yarn add pino
pnpm
pnpm add pino

Import

ESM
import pino from 'pino';

Quick Example

usage
import pino from 'pino';

const logger = pino({ level: 'info' });

logger.info('Server started');
logger.info({ port: 3000, env: 'production' }, 'Config loaded');
logger.error({ err: new Error('fail') }, 'Request failed');

const child = logger.child({ requestId: 'abc123' });

About pino

Pino is an extremely fast Node.js logger that outputs newline-delimited JSON (NDJSON) with minimal overhead. Pino achieves 5-10x higher logging throughput than alternatives like Winston by deferring log processing to a separate worker thread or external process. Instead of formatting, coloring, and routing logs within the application process, Pino writes raw JSON to stdout as fast as possible, then uses pino-pretty or other transport processes to format the output. This design ensures logging never becomes a bottleneck in high-throughput applications. Pino creates structured log entries with automatic timestamp, level, pid, and hostname fields, plus any custom properties passed to the log call. The library supports child loggers that inherit configuration and add default properties (useful for adding request IDs to all logs within a request handler), redaction of sensitive fields (passwords, tokens) via fast-redact, serializers for custom object formatting, and log level configuration. Pino integrates with Express (pino-http), Fastify (built-in), and Hapi through middleware. The pino ecosystem includes transports for Elasticsearch, Datadog, Loki, and file rotation.

Quick Facts

Packagepino
CategoryUtility
Weekly Downloads5M+
LicenseMIT
Installnpm install pino

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.