mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 04:45:56 +00:00
fix(logger): fix workflow logs
This commit is contained in:
parent
a44b9e256c
commit
ed6bd819ab
@ -8,10 +8,7 @@ export const getLoggerFilePath = (...paths: string[]): string => {
|
||||
};
|
||||
|
||||
export const getLoggerTransport = (): ('console' | 'file' | 'dailyRotateFile')[] =>
|
||||
(
|
||||
(process.env.LOGGER_TRANSPORT as any) ||
|
||||
(process.env.APP_ENV === 'development' ? 'console' : 'console,dailyRotateFile')
|
||||
).split(',');
|
||||
((process.env.LOGGER_TRANSPORT as any) || 'console,dailyRotateFile').split(',');
|
||||
|
||||
export const getLoggerFormat = (): 'logfmt' | 'json' | 'delimiter' | 'console' =>
|
||||
(process.env.LOGGER_FORMAT as any) || (process.env.APP_ENV === 'development' ? 'console' : 'json');
|
||||
|
@ -17,7 +17,6 @@ export class CustomRequestPlugin extends Plugin {
|
||||
const logger = this.createLogger({
|
||||
dirname: 'custom-request',
|
||||
filename: '%DATE%.log',
|
||||
transports: [...(process.env.NODE_ENV === 'production' ? ['dailyRotateFile'] : ['console'])],
|
||||
} as LoggerOptions);
|
||||
|
||||
return logger;
|
||||
|
@ -54,9 +54,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);
|
||||
|
Loading…
Reference in New Issue
Block a user