diff --git a/src/imports/utils/logger.ts b/src/imports/utils/logger.ts index 82a7b79..e82d207 100644 --- a/src/imports/utils/logger.ts +++ b/src/imports/utils/logger.ts @@ -4,7 +4,13 @@ import pretty from 'pino-pretty'; const level = (process.env.LOG_LEVEL || 'info') as pino.Level; -const stream: pino.StreamEntry[] = [{ level, stream: pretty({ colorize: true, translateTime: 'SYS:standard' }) }]; +const stream: pino.StreamEntry[] = []; + +if (process.env.LOG_PRETTY === 'true') { + stream.push({ level, stream: pretty({ colorize: true, translateTime: 'SYS:standard' }) }); +} else { + stream.push({ level, stream: process.stdout }); +} if (process.env.LOG_TO_FILE) { stream.push({ level, stream: fs.createWriteStream(process.env.LOG_TO_FILE, { flags: 'a' }) });