API Reference
Pino
Very low overhead Node.js logger with JSON output, async writes, and child loggers.
Official Documentation ↗CompatibilityThis documentation covers version
v9.5. Check the official docs for the latest API surface.Installation
npm
npm install pinopnpm
pnpm add pinoyarn
yarn add pinoMethods
No methods match this filter.
Pino is a very low overhead Node.js logger. It outputs newline-delimited JSON by default, supports child loggers, redaction, and worker-thread transports for non-blocking formatting.
Key Features
- Fast: Minimal overhead, synchronous JSON writes
- Child loggers: Cheap request-scoped context binding
- Redaction: Hide sensitive fields by path
- Transports: Worker-thread formatting and custom targets
- Async: Non-blocking logging for high-throughput services
API reference evidence
Fetched from official sources on 2026-11-08T19:26:00+08:00 via WebFetch https://raw.githubusercontent.com/pinojs/pino/main/docs/api.md(返回空);WebFetch https://cdn.jsdelivr.net/gh/pinojs/pino@latest/docs/api.md;WebFetch https://cdn.jsdelivr.net/npm/[email protected]/pino.d.ts.
pino()→ signature from https://cdn.jsdelivr.net/gh/pinojs/pino@latest/docs/api.md; official text: “##pino([options], [destination]) => loggerThe exportedpinofunction takes two optional arguments,optionsanddestination, and returns a logger instance.”log methods→ signature from https://cdn.jsdelivr.net/npm/[email protected]/pino.d.ts; official text: “interface LogFn { // TODO: why is this different fromobj: objectorobj: any? /* tslint:disable:no-unnecessary-generics */(obj: T, msg?: string, …args: any[]): void; (obj: unknown, msg?: string,” child→ signature from https://cdn.jsdelivr.net/npm/[email protected]/pino.d.ts; official text: “child(bindings: pino.Bindings, options?: ChildLoggerOptions ): pino.Logger<CustomLevels | ChildCustomLevels>;” redact→ signature from https://cdn.jsdelivr.net/npm/[email protected]/pino.d.ts; official text: “export interface redactOptions { paths: string[]; censor?: string | ((value: any, path: string[]) => any); remove?: boolean; }”
FAQ
- Why is Pino faster than Winston?
- Pino writes JSON synchronously to a stream with minimal allocation and defers formatting to a worker thread via transports. This keeps the main thread unblocked, yielding 3-5x higher throughput than Winston.
- How do I pretty-print Pino logs in development?
- Pipe output to pino-pretty, or set a transport with target: 'pino-pretty' in development. Avoid pretty-printing in production since it adds overhead and loses machine-readability.
- What is a child logger in Pino?
- A child logger pre-binds bindings like requestId that appear in every log line. Creating children is cheap and is the recommended way to add request-scoped context without per-call overhead.
Report a problem with this API docOpens a pre-filled issue on GitHub.