Created
September 14, 2018 08:45
-
-
Save devesh2605/2bbc672b3eba3846353d16832b616e2b to your computer and use it in GitHub Desktop.
Winston Logger
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
const winston = require('winston'); | |
const logger = new(winston.Logger)({ | |
transports: [ | |
new(winston.transports.Console)({ | |
json: false, | |
timestamp: true, | |
colorize: true, | |
}), | |
new winston.transports.File({ | |
filename: './Logs/debug.log', | |
maxsize: 100000000, | |
json: true | |
}) | |
], | |
exitOnError: false | |
}); | |
module.exports = logger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment