Skip to content

Winston Transport

NPM Version

Winston A logger for just about everything.

Transport Source

Installation

Install the required packages:

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

Setup

typescript
import winston from 'winston'
import { LogLayer } from 'loglayer'
import { WinstonTransport } from "@loglayer/transport-winston"

const w = winston.createLogger({})

const log = new LogLayer({
  transport: new WinstonTransport({
    logger: w
  })
})

Log Level Mapping

LogLayerWinston
tracesilly
debugdebug
infoinfo
warnwarn
errorerror
fatalerror