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
And then you have to deal with the inheritance. For example you want to change the request logging - then you have to skip using super and bring code from Faraday::Response::Middleware#call to it(To avoid duplicate logging for example). As of super would call a method from Faraday::Response::Logger and then it would propagate to Faraday::Response::Middleware.
Dealing with logging requests/response in faraday is non-transparent(for me at least). I have a suggestion(backed up by some code: #889) of separating log formatter from the logging middleware.
E.g. I would be happy to provide my formatter to the connection configuration:
That could be inherited from the base formatter with something like 2 methods to override: request and response.
Steps to reproduce
To see the issue I would recommend an exercise: integrate a structured logger(like SemanticLogger) or at least convert a multiline logging to a one-line-per-request(supporting bodies logging)
The text was updated successfully, but these errors were encountered:
Basic Info
I am concerned about the usability of request/response logging. At the moment one should override the logging middleware like that:
And then you have to deal with the inheritance. For example you want to change the request logging - then you have to skip using
super
and bring code fromFaraday::Response::Middleware#call
to it(To avoid duplicate logging for example). As ofsuper
would call a method fromFaraday::Response::Logger
and then it would propagate toFaraday::Response::Middleware
.Dealing with logging requests/response in
faraday
is non-transparent(for me at least). I have a suggestion(backed up by some code: #889) of separating log formatter from the logging middleware.E.g. I would be happy to provide my formatter to the connection configuration:
That could be inherited from the base formatter with something like 2 methods to override:
request
andresponse
.Steps to reproduce
To see the issue I would recommend an exercise: integrate a structured logger(like
SemanticLogger
) or at least convert a multiline logging to a one-line-per-request(supporting bodies logging)The text was updated successfully, but these errors were encountered: