Created
April 29, 2014 16:51
-
-
Save rtgibbons/11405931 to your computer and use it in GitHub Desktop.
another winston logger helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var winston = require('winston'); | |
var logger = new(winston.Logger)({ | |
transports: [ | |
new(winston.transports.Console)({ | |
level: 'debug', | |
colorize: true, | |
timestamp: true | |
}), | |
new winston.transports.File({ | |
level: 'debug', | |
filename: process.cwd() + '/logs/debug.log', | |
}) | |
], | |
exceptionHandlers: [ | |
new(winston.transports.Console)({ | |
colorize: true, | |
timestamp: true | |
}), | |
new winston.transports.File({ | |
filename: process.cwd() + '/logs/exceptions.log', | |
}) | |
], | |
exitOnError: true | |
}); | |
logger.info('Log Levels set to:', logger.levels); | |
module.exports = logger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment