From 6a2024fd54cc73890d8575d0b2ce32ed7dc3613d Mon Sep 17 00:00:00 2001 From: vlad-boroda Date: Fri, 10 May 2024 01:18:11 +0300 Subject: [PATCH] war with pino again --- src/starter/starter-app.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/starter/starter-app.ts b/src/starter/starter-app.ts index ae64c86..2a27829 100644 --- a/src/starter/starter-app.ts +++ b/src/starter/starter-app.ts @@ -1,3 +1,4 @@ +import { setTimeout } from 'timers/promises'; import type { INestApplication, Logger as NestLogger } from '@nestjs/common'; import { ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; @@ -74,6 +75,10 @@ export const startStarterApp = async ( await app.listen(config.http.port, '0.0.0.0'); const appUrl = await app.getUrl(); + // ugly solution for pino logging stack issue + // toplevel logger is not working properly and ships logs with delay + await setTimeout(1); + logger.log(`Listening on ${appUrl}`, loggerContext); if (config.swagger.enabled) {