diff --git a/src/logger/console-logger.service.ts b/src/logger/console-logger.service.ts index c87460bce..6640788d1 100644 --- a/src/logger/console-logger.service.ts +++ b/src/logger/console-logger.service.ts @@ -4,7 +4,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable, Optional, Scope } from '@nestjs/common'; +import { + Inject, + Injectable, + LoggerService, + Optional, + Scope, +} from '@nestjs/common'; import { isObject } from '@nestjs/common/utils/shared.utils'; import clc = require('cli-color'); import DateTimeFormatOptions = Intl.DateTimeFormatOptions; @@ -13,7 +19,7 @@ import { Loglevel } from '../config/loglevel.enum'; import { needToLog } from '../config/utils'; @Injectable({ scope: Scope.TRANSIENT }) -export class ConsoleLoggerService { +export class ConsoleLoggerService implements LoggerService { private classContext: string | undefined; private lastTimestamp: number; diff --git a/src/main.ts b/src/main.ts index d2b75f3a9..45bc1586e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,6 +18,7 @@ import { ConsoleLoggerService } from './logger/console-logger.service'; async function bootstrap(): Promise { const app = await NestFactory.create(AppModule, { logger: ['error', 'warn', 'log'] as LogLevel[], + bufferLogs: true, }); const logger = await app.resolve(ConsoleLoggerService); logger.log('Switching logger', 'AppBootstrap');