Pino Transport
Pino is a very low overhead Node.js logger, focused on performance.
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
LogLayer | Pino |
---|---|
trace | trace |
debug | debug |
info | info |
warn | warn |
error | error |
fatal | fatal |