1.0.11 • Published 6 years ago
salak-winston v1.0.11
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