From ee92823ee147148fef81305d1ca14be0832f5a3a Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Fri, 6 Sep 2024 18:17:55 -0700 Subject: [PATCH 1/3] chore: log process startup time Signed-off-by: OMPRAKASH MISHRA --- backend/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index 900459c56..f5c2cba28 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -1,11 +1,11 @@ import {NestExpressApplication} from "@nestjs/platform-express"; import {bootstrap} from "./app"; import {Logger} from "@nestjs/common"; - const logger = new Logger('NestApplication'); bootstrap().then(async (app: NestExpressApplication) => { await app.listen(3000); logger.log(`Listening on ${await app.getUrl()}`); + logger.log(`Process start up took ${process.uptime()} seconds`); }).catch(err=>{ logger.error(err); }); From 683bf43db185ec220521279f9352fc921f2796c5 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Fri, 6 Sep 2024 18:29:16 -0700 Subject: [PATCH 2/3] colorize Signed-off-by: OMPRAKASH MISHRA --- backend/src/common/logger.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/common/logger.config.ts b/backend/src/common/logger.config.ts index e09dbe691..66152d267 100644 --- a/backend/src/common/logger.config.ts +++ b/backend/src/common/logger.config.ts @@ -17,7 +17,8 @@ export const customLogger: LoggerService = WinstonModule.createLogger({ level: 'silly', format: winston.format.combine( globalLoggerFormat, - localLoggerFormat + localLoggerFormat, + winston.format.colorize({ all: true }) ), }), ], From 466f4d974d758cfc62e56072f5b805ac41097d77 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Fri, 6 Sep 2024 18:53:41 -0700 Subject: [PATCH 3/3] chore: only colorize the level not entire message Signed-off-by: OMPRAKASH MISHRA --- backend/src/common/logger.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/common/logger.config.ts b/backend/src/common/logger.config.ts index 66152d267..ae35cca6d 100644 --- a/backend/src/common/logger.config.ts +++ b/backend/src/common/logger.config.ts @@ -18,7 +18,7 @@ export const customLogger: LoggerService = WinstonModule.createLogger({ format: winston.format.combine( globalLoggerFormat, localLoggerFormat, - winston.format.colorize({ all: true }) + winston.format.colorize({ level: true }) ), }), ],