Skip to content

Commit 22e5bf6

Browse files
authored
Merge pull request #216 from AthennaIO/develop
chore: add channel and logger helper
2 parents efd68fe + 4141538 commit 22e5bf6

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/http",
3-
"version": "5.30.0",
3+
"version": "5.31.0",
44
"description": "The Athenna Http server. Built on top of fastify.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/kernels/HttpKernel.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,17 @@ export class HttpKernel {
277277
return
278278
}
279279

280-
Server.terminate(ctx => Log.channelOrVanilla('request').info(ctx))
280+
const { channel, isToLogRequest } = Config.get('http.logger')
281+
282+
Server.terminate(ctx => {
283+
if (!isToLogRequest) {
284+
return Log.channelOrVanilla(channel).info(ctx)
285+
}
286+
287+
if (isToLogRequest(ctx)) {
288+
return Log.channelOrVanilla(channel).info(ctx)
289+
}
290+
})
281291
}
282292

283293
/**

0 commit comments

Comments
 (0)