With ktor server, we set up `CallLogging` and `Sta...
# ktor
l
With ktor server, we set up
CallLogging
and
StatusPage
plugin we'd like to not log some NotFound responses (just because there are too many on some given routes - but not all)
CallLogging
already has
filter { false }
but it is still logging It seems to be ktor default behavior Is there any way to customize it?
g
filter indicates if something will be logged, not if something will not be logged. If you use :
Copy code
call.request.path().startsWith("/metrics")
then
/customers
will not be logged for example
l
I get it, but with
filter { false }
then it is supposed to log nothing isn't it ⁉️
g
Indeed that makes sense, can you try to use the
call
property and and non existing path? for example
call.request.path().startsWith("/doesnotexist")
l
I tried what you proposed, it still logs the error message If I change de response HttpStatusCode in
StatusPage
plugin to
OK
, then nothing is logged My conclusion is that this should be some default behavior of ktor with error responses
a
Can you please share a code snippet to illustrate the issue?