Skip to content

Instantly share code, notes, and snippets.

@lennym
Created November 25, 2014 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lennym/cdaff7802160162b701a to your computer and use it in GitHub Desktop.
Save lennym/cdaff7802160162b701a to your computer and use it in GitHub Desktop.
Logging with Winston
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