npm pino 7.0.0-rc.1

latest releases: 9.2.0, 9.1.0, 9.0.0...
2 years ago


  • First release of the v7 Release Candidate series.

All v7.0.0 release notes are included.

v7.0.0 release notes

New Features


Create a a stream that routes logs to a worker thread that
wraps around a Pino Transport.

const pino = require('pino')
const transport = pino.transport({
  target: 'some-transport',
  options: { some: 'options for', the: 'transport' }

Multiple transports may also be defined, and specific levels can be logged to each transport:

const pino = require('pino')
const transports = pino.transport({
  targets: [{
    level: 'info',
    target: 'some-transport',
    options: { some: 'options for', the: 'transport' }
  }, {
    level: 'trace',
    target: '#pino/file',
    options: { destination: '/path/to/store/logs' }

For more on transports, how they work, and how to create them see the Transports documentation.


We have embedded a part of pino-multi-stream into pino itself, so you would be able to write to multiple streams from the same pino instance:

var fs = require('fs')
var pino = require('pino')
var streams = [
  {stream: fs.createWriteStream('/tmp/')},
  {level: 'debug', stream: fs.createWriteStream('/tmp/')},
  {level: 'fatal', stream: fs.createWriteStream('/tmp/')}

var log = pino({
  level: 'debug' // this MUST be set at the lowest level of all the destinations
}, pino.multistream(streams))

log.debug('this will be written to /tmp/')'this will be written to /tmp/ and /tmp/')
log.fatal('this will be written to /tmp/, /tmp/ and /tmp/')

This differs from pino.transport() as all the streams will be executed within the main thread, i.e. the one that created the pino instance.

Added TypeScript types

Types have been added to the the project, so you can now use pino with TypeScript without downloading any additional types: you should remove @types/pino from your project. The following typescript example would now work correctly:

import { pino } from "pino";

const log = pino();"hello world");
log.error("this is at error level");"the answer is %d", 42);{ obj: 42 }, "hello world");{ obj: 42, b: 2 }, "hello world");
log. info({ obj: { aa: "bbb" } }, "another");

Breaking Changes

Dropped Node.js v10.x

Node.js v10 went out of LTS/Maintenance in April 2021.
We are dropping support.

Apply err serializer everywhere

We will start applying the err serializer also to Error objects passed in as first argument to log methods, e.g. Error('kaboom')) will pass through the serializer.

Pull Requests

  • removed all outstanding deprecations (#1057)
  • pino.transport() (#1003)
  • Add pino.multistream (#1004)
  • Add TS types (#913)
  • Apply err serializer everywhere. (#896)
  • Make the nestedKey only take effect in the serialized object and fix error detection and serialization #885

Don't miss a new pino release

NewReleases is sending notifications on new releases.