Skip to content

Instantly share code, notes, and snippets.

@thomasstep
Created July 29, 2019 18:48
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 thomasstep/050639462290894dcfcaf8c3f117b201 to your computer and use it in GitHub Desktop.
Save thomasstep/050639462290894dcfcaf8c3f117b201 to your computer and use it in GitHub Desktop.
Winston configuration
var winston = require('winston');
// In other files use var winston = require('./config/winston') and place this file in the app's config/ directory
var options = {
console: {
level: 'info',
handleExceptions: true,
json: true,
colorize: true,
},
};
var logger = new winston.Logger({
transports: [
new winston.transports.Console(options.console)
],
exitOnError: false, // do not exit on handled exceptions
});
module.exports = logger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment