I want to log all the requests my application makes. The application makes several call like this:
val client: Client = org.http4s.client.blaze.SimpleHttp1Client(...)
client.fetch(Request(method = GET, uri = aUri))
Is there a way of getting the client to log to a file all the requests?
(Using v0.12.4)
I got it working:
Based on the question, you have to modify your code to this:
import org.http4s.client.middleware.Logger
val client: Client = org.http4s.client.blaze.SimpleHttp1Client(...)
Logger(logBody = true, logHeaders = true)(client)
.fetch(Request(method = GET, uri = aUri))
So you have to wrap the client with a Logger
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With