Arnau Miro
06/19/2024, 11:13 AMcall.request.path().startsWith("/subscriptions")
but it is logging /health also, so it seems it is logging all
Thanks!Aleksei Tirman [JB]
06/19/2024, 11:24 AMArnau Miro
06/19/2024, 11:45 AMinstall(CallLogging) {
level = <http://Level.INFO|Level.INFO>
filter { call -> call.request.path().startsWith("/subscriptions") }
format { call ->
runBlocking {
val headersSet: MutableMap<String, String> = mutableMapOf()
call.request.headers.forEach { key, values ->
values.forEach { value ->
headersSet[key] = value
}
}
val headersString = headersSet.map { (key, value) -> "$key, $value" }.joinToString("-")
"Body: ${call.receiveText()} - Headers: $headersString"
}
}
}
Maybe there is a better way to print headersAleksei Tirman [JB]
06/19/2024, 1:14 PMembeddedServer(Netty, port = 4444) {
install(CallLogging) {
level = <http://Level.INFO|Level.INFO>
filter { call -> call.request.path().startsWith("/subscriptions") }
}
routing {
get("/subscriptions") {
call.respondText { "subscriptions" }
}
get("/health") {
call.respondText { "health" }
}
}
}.start(wait = true)
Arnau Miro
06/19/2024, 1:57 PMArnau Miro
06/19/2024, 2:18 PMArnau Miro
06/19/2024, 2:19 PMArnau Miro
06/19/2024, 2:20 PMArnau Miro
06/19/2024, 2:27 PMAleksei Tirman [JB]
06/19/2024, 6:22 PMArnau Miro
06/19/2024, 7:53 PM