Created
February 13, 2019 06:43
-
-
Save Necmttn/e704212ccbdc57a1155a68e384741c82 to your computer and use it in GitHub Desktop.
Better CloudWatch Logs.
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 logger = winston.createLogger({ | |
level: 'debug', | |
// (typeof(process.env.NODE_ENV) === 'string' && process.env.NODE_ENV.startsWith('prod')) | |
// ? 'info' | |
// : 'debug', | |
format: winston.format.combine( | |
winston.format.timestamp(), | |
winston.format.splat(), | |
winston.format.json() | |
), | |
transports: [ | |
new winston.transports.Console() | |
] | |
}); | |
module.exports = logger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment