
pino
A fast JSON logger for Node.js that writes structured log lines.
- Stars
- 18.3k
- Forks
- 1k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 30 days ago
- Type
- Library
What it is
Pino is a logging library for JavaScript that writes each log message as a single JSON object. Structured logs are easier for software and log services to search and filter than plain text. The README describes it as very low overhead, so it is meant to add little cost to a running application.
- Log each HTTP request and response in an Express, Fastify, or Koa app using the documented framework guides
- Create a child logger that attaches a fixed property, such as a request ID, to every message it writes
- Format logs during development with the pino-pretty module
- Send logs to external destinations by running a transport in a worker thread
Great for
- Node.js backend developers who want structured JSON logs
- Teams running web servers that log many requests per second
- Projects that need to forward logs to other systems through transports
- Developers who want a simple logger with child loggers for adding context
Not ideal for
- People who only want plain-text console output with no setup (the JSON output is hard to read without a formatter like pino-pretty)
- Non-JavaScript projects, since the library is built for Node.js
- Users who need a full log management platform; Pino writes and routes logs but does not store or visualize them
How to get it
- 1
Install with a package manager
You'll need: Node.js
Install with NPM
npm install pinoInstall with Yarn
yarn add pino - 2
Run it
- Install the package with npm install pino
- Create a logger with const logger = require('pino')()
- Call logger.info('hello world') to write a first JSON log line
- Create a child logger with logger.child({ a: 'property' }) to add fixed fields
- 3
Get the most out of it
- Use the pino.transport API to run log processing in a worker thread, as the README recommends
- Install pino-pretty for readable logs during development
- Follow the framework guides (Fastify, Express, Hapi, Koa, Nest, Hono) to log requests automatically
- Read the redaction and child logger docs to hide sensitive fields and add context
Downloads
Strengths
- The README reports that Pino is often over 5x faster than alternatives, with benchmarks linked for verification
- Output is standard JSON, which works with most log tools
- Has documented integrations for many web frameworks and supports bundling with webpack or esbuild
Trade-offs
- Log processing such as sending or reformatting should be moved to transports, which adds setup complexity
- Output is raw JSON by default, so readability requires an extra tool during development
- Speed claims come from the project's own benchmarks, so results will vary by workload
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| pino (this) | 18.3k | Library | beginner | 30 days ago | Node.js backend developers who want structured JSON logs |
| winston | 24.5k | Library | intermediate | 4 months ago | Node.js developers who need structured or file-based application logs |
| json | 50.8k | Library | beginner | 4 days ago | C++ developers who need to read or write JSON in an application |
| cli | 24.3k | Library | intermediate | 4 days ago | Go developers writing a command line tool with subcommands and flags |
| SwiftyJSON | 22.9k | Library | beginner | 3 months ago | Swift developers building iOS, macOS, tvOS or watchOS apps that read JSON from web APIs |
| monolog | 21.4k | Library | intermediate | 5 days ago | PHP developers who need structured logs from an application |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.