fix(logger): 修复日志写入报错
Some checks failed
/ release (push) Failing after 20s

This commit is contained in:
zhaoyingbo 2024-10-12 07:41:37 +00:00
parent 25af9b763b
commit 867edc964d

View File

@ -1,6 +1,5 @@
import "winston-daily-rotate-file"
import winston, { format } from "winston" import winston, { format } from "winston"
import DailyRotateFile from "winston-daily-rotate-file"
const isProd = process.env.NODE_ENV === "production" const isProd = process.env.NODE_ENV === "production"
@ -19,7 +18,7 @@ if (isProd) {
} }
transports.push( transports.push(
new winston.transports.DailyRotateFile({ new DailyRotateFile({
level: "info", level: "info",
filename: filename:
process.env.LOG_FILE_NAME_INFO ?? "/home/work/log/egg-info-%DATE%.log", process.env.LOG_FILE_NAME_INFO ?? "/home/work/log/egg-info-%DATE%.log",
@ -27,7 +26,7 @@ if (isProd) {
}) })
) )
transports.push( transports.push(
new winston.transports.DailyRotateFile({ new DailyRotateFile({
level: "debug", level: "debug",
filename: filename:
process.env.LOG_FILE_NAME_DEBUG ?? process.env.LOG_FILE_NAME_DEBUG ??