Created
August 12, 2020 14:26
-
-
Save gokoro/8ce8fadd52479bbd2c7cc472f8717e41 to your computer and use it in GitHub Desktop.
Default logging setting for winston package
This file contains 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 config = require('../config') | |
const logger = winston.createLogger({ | |
level: config.logLevel, | |
format: winston.format.combine( | |
winston.format.errors({ stack: true }), | |
winston.format.splat(), | |
winston.format.ms(), | |
winston.format.json() | |
), | |
transports: [ | |
new winston.transports.Console({ | |
format: winston.format.combine( | |
winston.format.colorize(), | |
winston.format.simple(), | |
) | |
}) | |
] | |
}) | |
module.exports = logger |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment