fix(logger): fix the issue where workflow log files do not output (#4657)

This commit is contained in:
YANG QIA 2024-06-13 22:53:02 +08:00 committed by GitHub
parent c2687f71e3
commit d8e80ecb41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -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;

View File

@ -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);