You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using the Faraday response logger middleware in some projects, however the output is a bit confusing because it does not follow a similar structure for request/response log lines. Right now here is what you get in your logs if you make a request with this middleware enabled:
get https://api.example.com
Status: 200
This might get even more confusing depending on you log formatter settings. I propose to follow the same structure for request/response logs, in a way that each line can be clearly inspected later. It would then look like this:
request: GET https://api.example.com
response: Status 200
Where the request and response strings are set as the progname of the INFO log calls accordingly, just like the debug lines currently work.
I've already made a branch with this implementation and added the required tests, if you like it I can open a PR.
The text was updated successfully, but these errors were encountered:
Hi @erichmachado, thanks for raising this!
Yes please provide a link to your branch so I can have a better look.
Sounds solid in principal, I just need to consider if this is going to break existing behaviour and eventually plan it for v1.0
The branch looks good.
I also had a quick look at the file history and it looks like this inconsistency has been there since the beginning (6 years ago).
I don't think this should break any existing implementation as we're simply changing formatting for the logs.
Basic Info
Issue description
I am currently using the Faraday response logger middleware in some projects, however the output is a bit confusing because it does not follow a similar structure for request/response log lines. Right now here is what you get in your logs if you make a request with this middleware enabled:
This might get even more confusing depending on you log formatter settings. I propose to follow the same structure for request/response logs, in a way that each line can be clearly inspected later. It would then look like this:
Where the
request
andresponse
strings are set as theprogname
of the INFO log calls accordingly, just like the debug lines currently work.I've already made a branch with this implementation and added the required tests, if you like it I can open a PR.
The text was updated successfully, but these errors were encountered: