any idea on how I can log the requests and responses I get via aleph client ? I can't seem to figure this out based on the docs. I've tried several combinations, including:
(netty/set-logger! :slf4j)
(def conn-pool (http/connection-pool {:connection-options {:log-activity :trace}
:log-activity :trace}))
and using this like:
req (merge {:method :get
:pool conn-pool
:url url} opts)
I can see my log messages but nothing from aleph http client
p.s. I am willing to improve the docs for thisOne simple approach is to compose functions on to the deferred response. Something like this:
(manifold.deferred/chain (http/request req) (fn [response] (log/info :response response) response))I often convert my responses into a map of request and response in all cases to make testing and debugging easier using a similar approach.
thanks, but I might be doing something wrong, because it does not work for me
(try+
(let [res (-> @(d/chain (http/request req)
(fn [response] (log/info "WHAAAA " :response response) response)))
body (:body res)]
(log/info "Writing statement to file" file)
(bs/transfer body file))
I can see "Writing statement" line but nothing for the manifold chainso it seems to work but I was looking for the logs in the wrong window
I was about to ask about log configuration and tooling. Glad to hear you've found the output. 🙂
yeah, the experience is not great (being gentle). I'll see if I can improve it somehow (docs at least)
thanks for the help 🙂
@eugen.stan doc improvements are always welcome. Maybe it belongs in examples/?
there was some logging in the repl output window and some (from timbre) in the calva output file. that was a bit confusing. I was checking only calva output file