From 867edc964da2de914076a2333dd3e78f3deb3432 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Sat, 12 Oct 2024 07:41:37 +0000 Subject: [PATCH] =?UTF-8?q?fix(logger):=20=E4=BF=AE=E5=A4=8D=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=86=99=E5=85=A5=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/logger/src/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index 07b3409..a807d7a 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -1,6 +1,5 @@ -import "winston-daily-rotate-file" - import winston, { format } from "winston" +import DailyRotateFile from "winston-daily-rotate-file" const isProd = process.env.NODE_ENV === "production" @@ -19,7 +18,7 @@ if (isProd) { } transports.push( - new winston.transports.DailyRotateFile({ + new DailyRotateFile({ level: "info", filename: process.env.LOG_FILE_NAME_INFO ?? "/home/work/log/egg-info-%DATE%.log", @@ -27,7 +26,7 @@ if (isProd) { }) ) transports.push( - new winston.transports.DailyRotateFile({ + new DailyRotateFile({ level: "debug", filename: process.env.LOG_FILE_NAME_DEBUG ??