fix: logger should log in file default (#1429)

Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#1429
This commit is contained in:
sealday 2024-08-01 18:32:42 +08:00
parent 3277715c8a
commit b8eac59a07

View File

@ -8,10 +8,7 @@ export const getLoggerFilePath = (...paths: string[]): string => {
}; };
export const getLoggerTransport = (): ('console' | 'file' | 'dailyRotateFile')[] => export const getLoggerTransport = (): ('console' | 'file' | 'dailyRotateFile')[] =>
( ((process.env.LOGGER_TRANSPORT as any) || 'console,dailyRotateFile').split(',');
(process.env.LOGGER_TRANSPORT as any) ||
(process.env.APP_ENV === 'development' ? 'console' : 'console,dailyRotateFile')
).split(',');
export const getLoggerFormat = (): 'logfmt' | 'json' | 'delimiter' | 'console' => export const getLoggerFormat = (): 'logfmt' | 'json' | 'delimiter' | 'console' =>
(process.env.LOGGER_FORMAT as any) || (process.env.APP_ENV === 'development' ? 'console' : 'json'); (process.env.LOGGER_FORMAT as any) || (process.env.APP_ENV === 'development' ? 'console' : 'json');