salak-winston

1.0.11 • Public • Published

salak-winston

NPM version David deps NPM download

Winston3 for salak

Features

  1. Better Console Formatter
  2. DailyRotateFile

Usage

install

npm install --save salak-winston

example

const winston = require('salak-winston')
const { combine, timestamp, label } = winston.format
 
const logger = winston.createLogger({
  format: combine(
    label({ label: 'logger' }),
    timestamp()
  ),
  transports: [
    new winston.transports.SalakConsole(),
    new winston.transports.DailyFile({
      filename: 'logger.log',
      dirname: '/tmp',
      dataPattern: 'YYYY-MM-DD'
    })
  ]
})
 
logger.info('test')

License

MIT

/salak-winston/

    Package Sidebar

    Install

    npm i salak-winston

    Weekly Downloads

    0

    Version

    1.0.11

    License

    MIT

    Unpacked Size

    13.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • wengeek