Fork me on GitHub
#aleph
<
2018-12-01
>
valerauko11:12:56

is there a way to debug / dump requests sent by the aleph http client?

valerauko11:12:29

i'm having some requests mysteriously fail and i'd love to see what headers aleph actually sent

gsnewmark11:12:15

There are couple of request debugging options since the 0.4.7-alpha2 (I'm not actually sure about the version, but it's in the current master for sure). Here are the details https://github.com/ztellman/aleph/pull/401 (cc @kachayev)

valerauko12:12:42

oh so there's no way to do it in earlier versions? i'm on 0.4.6

gsnewmark12:12:23

I'm afraid there is nothing ready to use out of the box, but you can still add Netty's LoggingHandler manually (just like it's done in the PR https://github.com/ztellman/aleph/pull/401/files#diff-e2d1dde5203e0962010d2fb176031b3cR418) using the :pipeline-transform option of the connection pool https://github.com/ztellman/aleph/blob/ef331d14fabb629f94bc46b96af92b0e7d9ec37f/src/aleph/http.clj#L108. Basically you should pass a function which accepts a pipeline as :pipeline-transform, create a LoggingHandler in it, and call (.addFirst pipeline "activity-logger" logger) (just don't forget to return the pipeline itself from the passed function)

valerauko12:12:29

thanks for the suggestion

valerauko12:12:47

i managed to get the logging work based on the code you pointed out

valerauko12:12:08

but since the request in question is over https it's all encrypted

valerauko12:12:20

is logging possible on one layer higher?

gsnewmark12:12:04

It should be possible using some combination of handlers added to the pipeline, but I don't have an example at hand :( Can you update the Aleph by any chance?

valerauko12:12:23

yeah i'll try that for now

valerauko12:12:38

thanks for the help!