winston-configure
Declarative configuration for winston loggers.
Supports:
- Configuring multiple loggers in one command
- Configuring the default transports for none specific loggers
- Using shared transports definitions
Install
npm install winston-configure
Usage
var winstonConfigure = require('winston-configure');
winstonConfigure({
transports: {
errorConsole: {
type: 'Console',
level: 'error'
},
debugConsole: {
type: 'Console',
level: 'debug'
}
},
loggers: {
default: ['errorConsole'],
myLogger: [],
myLogger2: ['debugConsole', {
type: 'File',
level: 'error',
filename: 'test.log'
}]
}
});
var myLogger = winston.loggers.get('myLogger');