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 install pino
yarn add pino
pnpm add pino
Import
import pino from 'pino';
Quick Example
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
| Package | pino |
| Category | Utility |
| Weekly Downloads | 5M+ |
| License | MIT |
| Install | npm install pino |
Related Packages
Winston is the most popular logging library for Node.js, designed to be a simple and universal loggi…
Morgan is an HTTP request logger middleware for Node.js that records incoming request details in a c…
debug is a tiny JavaScript debugging utility modeled after Node.js core's debugging technique, provi…
Fastify is a high-performance web framework for Node.js designed to be the fastest HTTP framework av…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.