Created
November 25, 2014 11:28
-
-
Save lennym/cdaff7802160162b701a to your computer and use it in GitHub Desktop.
Logging with Winston
This file contains hidden or 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 config = require('./config'); | |
var logger = new winston.Logger({ | |
transports: [ | |
new winston.transports.Console({ colorize: true }), | |
new winston.transports.File({ filename: config['app-log'], json: false }) | |
], | |
exceptionHandlers: [ | |
new winston.transports.Console({ colorize: true }), | |
new winston.transports.File({ filename: config['error-log'], json: false }) | |
] | |
}); | |
module.exports = logger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment