Skip to content

Pino Transport

NPM Version

Pino is a very low overhead Node.js logger, focused on performance.

Transport Source

Installation

Install the required packages:

sh
npm i loglayer @loglayer/transport-pino pino
sh
pnpm add loglayer @loglayer/transport-pino pino
sh
yarn add loglayer @loglayer/transport-pino pino

Setup

typescript
import pino, { P } from 'pino'
import { LogLayer } from 'loglayer'
import { PinoTransport } from "@loglayer/transport-pino"

const p = pino({
  level: 'trace'  // Enable all log levels
})

const log = new LogLayer({
  transport: new PinoTransport({
    logger: p
  })
})

Log Level Mapping

LogLayerPino
tracetrace
debugdebug
infoinfo
warnwarn
errorerror
fatalfatal