Hi! I have a question regarding call logging in Kt...
# ktor
a
Hi! I have a question regarding call logging in Ktor (1.2.4). When a request comes with 'bad' json, i.e. some fields are missing and deserializaition is failing, then with
CallLogging
feature the bad request message is logged to the default level setup in CallLoggin feature configuration. So if I have a default level
INFO
then I'll see something like this in logs
Copy code
{
  "level": "INFO",
  "logger": "Application",
  "message": "400 Bad Request: POST - <routing_path>"
}
Is there a way to change the logging level of such request? Even if I do something like this in the
CallLogging
configuration, the log level is still a default one, i.e.
INFO
in my case
Copy code
filter { call ->
   val status = call.response.status()?.value
   level = Level.WARN
   status !in (200..399)
}
m
level configuration is done in the Feature lambda, not inside the filter: https://ktor.io/servers/features/call-logging.html#configuring
👍 1
out of curiosity: why are your lo messages in JSON? Are you using logstash,fluentbit or similar?
a
Yep, fluentbit and then logs are fed to kibana
👍 1