Skip to content

pino

A fast JSON logger for Node.js that writes structured log lines.

Stars
18.3k
Forks
1k
Licence
MIT
Language
JavaScript
Last update
1 months 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
Step-by-step guide: how to use pinoInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js

    Install with NPM

    npm install pino

    Install with Yarn

    yarn add pino
  2. 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. 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

ProjectStarsTypeLevelUpdatedBest for
pino (this)18.3kLibrarybeginner1 months agoNode.js backend developers who want structured JSON logs
winston24.5kLibraryintermediate4 months agoNode.js developers who need structured or file-based application logs
json50.8kLibrarybeginner4 days agoC++ developers who need to read or write JSON in an application
cli24.3kLibraryintermediate4 days agoGo developers writing a command line tool with subcommands and flags
SwiftyJSON22.9kLibrarybeginner3 months agoSwift developers building iOS, macOS, tvOS or watchOS apps that read JSON from web APIs
monolog21.4kLibraryintermediate5 days agoPHP 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.