opentripplanner / OpenTripPlanner

An open source multi-modal trip planner

Home Page:http://www.opentripplanner.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibility to log response body of HTTP calls if there is an error

optionsome opened this issue · comments

Is your feature request related to a problem? Please describe.
Currently we only log the status code. However, sometimes the response body contains useful information about the error. Although, the response can be big so we shouldn't log it fully/always.

Goal / high level use-case
Improve ability to debug issues with calling external APIs.

Describe the solution you'd like
We can discuss the possible solutions here.

Additional context
Noticed this limitation while calling an API that returned 406 that I couldn't reproduce locally and the API would have returned in the response what is the actual issue.

We discussed this in a dev meeting yesterday and came to the conclusion that we should pass in a trace logger in to the OTP HTTP client from where it's used from. We can then enable the login through logback configuration only for the relevant user of the HTTP client when necessary.