feat(logger): 修改日志打印级别
All checks were successful
/ release (push) Successful in 28s

This commit is contained in:
zhaoyingbo 2024-11-26 11:27:52 +00:00
parent 91d5b90eb0
commit 992409bf86

View File

@ -5,7 +5,7 @@ const isProd = process.env.NODE_ENV === "production"
const transports: any[] = [
new winston.transports.Console({
level: isProd ? "info" : "debug",
level: isProd ? "info" : "silly",
}),
]
@ -16,15 +16,6 @@ if (isProd) {
maxSize: "20m",
maxFiles: "14d",
}
transports.push(
new DailyRotateFile({
level: "info",
filename:
process.env.LOG_FILE_NAME_INFO ?? "/home/work/log/egg-info-%DATE%.log",
...config,
})
)
transports.push(
new DailyRotateFile({
level: "debug",
@ -34,6 +25,16 @@ if (isProd) {
...config,
})
)
transports.push(
new DailyRotateFile({
level: "silly",
filename:
process.env.LOG_FILE_NAME_SILLY ??
"/home/work/log/egg-silly-%DATE%.log",
...config,
})
)
}
const formatList = [