Skip to content

Commit 5b3e574

Browse files
Merge pull request #4214 from RedisInsight/fix-bootstrap-logger
Fix bootstrap logger
2 parents 06aac53 + 309bb38 commit 5b3e574

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

redisinsight/api/src/main.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'dotenv/config';
33
import { NestFactory } from '@nestjs/core';
44
import { SwaggerModule } from '@nestjs/swagger';
55
import { NestExpressApplication } from '@nestjs/platform-express';
6-
import { INestApplication, NestApplicationOptions } from '@nestjs/common';
6+
import { INestApplication, Logger, NestApplicationOptions } from '@nestjs/common';
77
import * as bodyParser from 'body-parser';
88
import { GlobalExceptionFilter } from 'src/exceptions/global-exception.filter';
99
import { get, Config } from 'src/utils';
@@ -76,14 +76,13 @@ export default async function bootstrap(apiPort?: number): Promise<IApp> {
7676
const logFileProvider = app.get(LogFileProvider);
7777

7878
await app.listen(apiPort || port, host);
79-
logger.log({
80-
message: `Server is running on http(s)://${host}:${port}`,
81-
context: 'bootstrap',
82-
});
79+
80+
const bootstrapLogger = new Logger('boostrap');
81+
bootstrapLogger.log(`Server is running on http(s)://${host}:${port}`);
8382

8483
const gracefulShutdown = (signal) => {
8584
try {
86-
logger.log(`Signal ${signal} received. Shutting down...`);
85+
bootstrapLogger.log(`Signal ${signal} received. Shutting down...`);
8786
logFileProvider.onModuleDestroy();
8887
} catch (e) {
8988
// ignore errors if any

0 commit comments

Comments
 (0)