feat(logger): 正式环境的文件写入地址支持从环境变量中取
All checks were successful
/ release (push) Successful in 32s

This commit is contained in:
zhaoyingbo 2024-09-23 11:41:14 +00:00
parent b7814eb8f2
commit d3bd60576f

View File

@ -21,14 +21,17 @@ if (isProd) {
transports.push(
new winston.transports.DailyRotateFile({
level: "info",
filename: "/home/work/log/egg-info-%DATE%.log",
filename:
process.env.LOG_FILE_NAME_INFO ?? "/home/work/log/egg-info-%DATE%.log",
...config,
})
)
transports.push(
new winston.transports.DailyRotateFile({
level: "debug",
filename: "/home/work/log/egg-debug-%DATE%.log",
filename:
process.env.LOG_FILE_NAME_DEBUG ??
"/home/work/log/egg-debug-%DATE%.log",
...config,
})
)