salak-winston
v1.0.11
Published
winston3.0 for salak
Downloads
10
Readme
salak-winston
Winston3 for salak
Features
- Better Console Formatter
- 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