wip: removing console log

This commit is contained in:
Lin, Hung-Shin committed 2023-11-20 14:59:14 +08:00
1 parent 515aefcadc
commit 82d1004ecf
16 files changed
+57 -34

No files matched your search

+11 -3
View File
@@ -1,16 +1,24 @@
import winston from 'winston'
import config from '../config.js'
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
defaultMeta: { service: 'user-service' },
defaultMeta: { service: 'backend', timestamp: new Date().toISOString() },
transports: [
//
// - Write all logs with importance level of `error` or less to `error.log`
// - Write all logs with importance level of `info` or less to `combined.log`
//
new winston.transports.File({ filename: 'error.log', level: 'error' }),
new winston.transports.File({ filename: 'combined.log' }),
new winston.transports.File({
dirname: config.log.path,
filename: 'error.log',
level: 'error',
}),
new winston.transports.File({
dirname: config.log.path,
filename: 'combined.log',
}),
],
})