Skip to content

Instantly share code, notes, and snippets.

@rtgibbons rtgibbons/logger.js
Created Apr 29, 2014

Embed
What would you like to do?
another winston logger helper
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
You can’t perform that action at this time.