feat: add console logger in production

This commit is contained in:
Justin Lin committed 2025-04-27 12:34:27 +08:00
1 parent b64cc6028c
commit eaced63c68
1 file changed
+3 -12
+3 -12
View File
@@ -23,19 +23,10 @@ const logger = winston.createLogger({
dirname: config.log.path,
filename: 'combined.log',
}),
new winston.transports.Console({
format: winston.format.simple(),
}),
],
})
//
// If we're not in production then log to the `console` with the format:
// `${info.level}: ${info.message} JSON.stringify({ ...rest }) `
//
if (process.env.NODE_ENV !== 'production') {
logger.add(
new winston.transports.Console({
format: winston.format.simple(),
})
)
}
export default logger