Hi guys! Which is the best way to intercept reques...
# ktor
a
Hi guys! Which is the best way to intercept request and response to print body on logs? I have something like this but event with DoubleReceive I get io.ktor.request.RequestAlreadyConsumedException
Copy code
environment.monitor.subscribe(Routing.RoutingCallStarted) { call: RoutingApplicationCall ->
    println("Route started: ${call.route}")
    runBlocking { println(call.receiveText()) }
}
r
There's logging features for client and server, fyi. And a double receive one that I think would enable what you have.
a
Thanks Ryan! I have used also the CallLogging but the problem is that even having DoubleReceive enabled it gives me RequestAlreadyConsumedException
r
That seems like a bug then, as long as you're using one of the supported request types (which from the snippet it looks like you are).
h
@Arnau Miro which version of Ktor are you using?
a
1.5.2
🙏 1
106 Views