Super fast, all natural JSON logger for Node.js
open sourceMITfree
Pino is a low-overhead JSON logger for Node.js: each log line is a JSON object with its level, time and message, and child loggers add fields of their own. Its maintainers say it's often more than five times faster than alternatives, and it keeps work off the event loop by running log processing (shipping, alerting, reformatting) as transports in a worker thread through its pino.transport API. It also has redaction of sensitive fields, a browser API, pino-pretty for readable output in development, support for bundlers such as webpack and esbuild, and integrations for web frameworks including Fastify and Express. It runs on Bare and Pear through the pino-bare module.
Problems it solves
- add fast structured JSON logging to my Node.js service
- log without slowing down my Node API's requests per second
- redact passwords and tokens from my application logs
Features
- structured JSON log lines
- child loggers with bound fields
- transports run in a worker thread
- redaction of sensitive fields
- browser API
- pino-pretty for development output
- webpack and esbuild bundling support
Limitations
- Log processing should run as a transport in a worker thread or separate process, not in the app itself, because of Node's single-threaded event loop1
Alternatives
The same job
These do what Pino does.
- winston Node.js logging library with multiple transports, levels and formats
