From d8e80ecb413cc2b886f266d5c85d74215d6a148d Mon Sep 17 00:00:00 2001 From: YANG QIA <2013xile@gmail.com> Date: Thu, 13 Jun 2024 22:53:02 +0800 Subject: [PATCH] fix(logger): fix the issue where workflow log files do not output (#4657) --- .../plugin-action-custom-request/src/server/plugin.ts | 1 - .../plugins/@nocobase/plugin-workflow/src/server/Plugin.ts | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-action-custom-request/src/server/plugin.ts b/packages/plugins/@nocobase/plugin-action-custom-request/src/server/plugin.ts index b43d78b0a8..0fc563fd39 100644 --- a/packages/plugins/@nocobase/plugin-action-custom-request/src/server/plugin.ts +++ b/packages/plugins/@nocobase/plugin-action-custom-request/src/server/plugin.ts @@ -26,7 +26,6 @@ export class PluginActionCustomRequestServer extends Plugin { const logger = this.createLogger({ dirname: 'custom-request', filename: '%DATE%.log', - transports: [...(process.env.NODE_ENV === 'production' ? ['dailyRotateFile'] : ['console'])], } as LoggerOptions); return logger; diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts index 9250e6868f..25045a7aca 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/Plugin.ts @@ -121,9 +121,8 @@ export default class PluginWorkflowServer extends Plugin { } const logger = this.createLogger({ - dirname: path.join('workflows', date), - filename: `${workflowId}.log`, - transports: [...(process.env.NODE_ENV !== 'production' ? ['console'] : ['file'])], + dirname: path.join('workflows', String(workflowId)), + filename: '%DATE%.log', } as LoggerOptions); this.loggerCache.set(key, logger);