Open vemv opened 3 months ago
I reckon that a workaround would be to dissoc the org.apache.http.impl.client.InternalHttpClient which is deep inside the Timbre context I was logging and very much irrelevant.
Aaah, we should do a similar thing for the context map as we do to the ExceptionInfo data map, see process-ex-data-map and the docstring of default-ex-data-field-fn. clj-http puts the client class into the ExceptionInfo data map, so when a HTTP request fails, we a non-serialiable object in the data map.
Should though recursively walk through the context and the ExceptionInfo data map, probably.
Good to hear!
Just in case, I applied the described workaround so I'd be fine with any outcome for this issue.
After starting to use the :json-error-fn, I found about the following happening when logging http-related stuff:
My guess is that jsonista knows how to encode PersistentHashMaps (ref), but not how to encode InternalHttpClients.
Thoughts? It would not be reasonable for timbre-json-appender/jsonista to know about every class imaginable.
I don't immediately know if jsonista has a recipe for this. Worst-case scenario one could experiment with clojure.data.json, which I hear got a lot faster in recent times.
Thanks - V