diff --git a/package-lock.json b/package-lock.json index cab3237..1b7f4ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/http", - "version": "5.30.0", + "version": "5.31.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/http", - "version": "5.30.0", + "version": "5.31.0", "license": "MIT", "devDependencies": { "@athenna/artisan": "^5.6.0", diff --git a/package.json b/package.json index b202cf3..6003efd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/http", - "version": "5.30.0", + "version": "5.31.0", "description": "The Athenna Http server. Built on top of fastify.", "license": "MIT", "author": "João Lenon ", diff --git a/src/kernels/HttpKernel.ts b/src/kernels/HttpKernel.ts index 307b1dc..c5c9f3a 100644 --- a/src/kernels/HttpKernel.ts +++ b/src/kernels/HttpKernel.ts @@ -277,7 +277,17 @@ export class HttpKernel { return } - Server.terminate(ctx => Log.channelOrVanilla('request').info(ctx)) + const { channel, isToLogRequest } = Config.get('http.logger') + + Server.terminate(ctx => { + if (!isToLogRequest) { + return Log.channelOrVanilla(channel).info(ctx) + } + + if (isToLogRequest(ctx)) { + return Log.channelOrVanilla(channel).info(ctx) + } + }) } /**