Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad request are logged on the default level #1465

Open
ghost opened this issue Nov 28, 2019 · 1 comment
Open

Bad request are logged on the default level #1465

ghost opened this issue Nov 28, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 28, 2019

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 fails, then with CallLogging feature the bad request message is logged to the default level setup in CallLogging feature configuration. So if I have a default level INFO then I'll see something like this in logs

{
   "level": "INFO",
   "logger":"Application",
   "message":"400 Bad Request: POST - <routing_path>"
}

Is there a way to change the logging level of the failing 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

filter { call ->
   val status = call.response.status()?.value
   level = Level.WARN
   status !in (200..399)
}
@ghost ghost changed the title Bad request are logged on default level Bad request are logged on the default level Nov 28, 2019
@oleg-larshin
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants