This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-12
Channels
- # ai (1)
- # aleph (11)
- # announcements (9)
- # aws (1)
- # beginners (61)
- # chlorine-clover (2)
- # clj-kondo (1)
- # clojure (35)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (1)
- # clojure-filipino (1)
- # clojure-france (2)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (1)
- # clojured (14)
- # clojurescript (45)
- # cursive (8)
- # data-science (2)
- # events (1)
- # fulcro (2)
- # gratitude (4)
- # helix (1)
- # honeysql (3)
- # introduce-yourself (1)
- # malli (4)
- # minecraft (4)
- # nbb (23)
- # off-topic (57)
- # polylith (4)
- # reagent (2)
- # sci (23)
- # shadow-cljs (7)
- # vim (1)
- # xtdb (17)
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.
(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 chainI 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)
@U011NGC5FFY doc improvements are always welcome. Maybe it belongs in examples/
?