Created
July 27, 2016 15:37
-
-
Save deepakshrma/552ed30a20b2d32af09bb3301be5c1ca to your computer and use it in GitHub Desktop.
Singleton logger
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
use strict'; | |
var winston = require('winston'); | |
var config = require('./winston.config'); | |
winston.emitErrs = true; | |
var logger = new winston.Logger({ | |
level: 'debug', | |
levels: config.defaults.levels, | |
handleExceptions: true, | |
transports: [ | |
new winston.transports.Console(config.env[process.env.NODE_ENV] || config.env.development) | |
], | |
exitOnError: false | |
}); | |
winston.addColors(config.defaults.colors) | |
module.exports = logger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment