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
Currently formatHttpRequest and formatHttpResponse handle server-side request and response objects (from node core and some of the http frameworks). It would be nice to support the client-side request and response objects:
client-side request is a http.ClientRequest returned from http.request() and http.get()
client-side response is a http.IncomingMessage returned from the "response" event of a client http.request()
Normally I'm opposed to DWIM'ing, but it would be nice if it could be managed here without gross heuristics and ambiguity. Node core docs (and likely lots of community docs) commonly refer to both server-side and client-side requests and responses as req and res. Just logging those variables as is would be nice.
One potential issue is if this blows up to a desire to support many varying "client request" and "client response" objects from Node-land http client libraries. I don't know if that would be the case.
Currently
formatHttpRequest
andformatHttpResponse
handle server-side request and response objects (from node core and some of the http frameworks). It would be nice to support the client-side request and response objects:http.ClientRequest
returned fromhttp.request()
andhttp.get()
http.IncomingMessage
returned from the "response" event of a clienthttp.request()
Normally I'm opposed to DWIM'ing, but it would be nice if it could be managed here without gross heuristics and ambiguity. Node core docs (and likely lots of community docs) commonly refer to both server-side and client-side requests and responses as
req
andres
. Just logging those variables as is would be nice.One potential issue is if this blows up to a desire to support many varying "client request" and "client response" objects from Node-land http client libraries. I don't know if that would be the case.
FWIW, some minor prior art is handling for
client_req
andclient_res
log record fields in Bunyan andclient_req
andclient_res
serializers for Bunyan in the restify-clients package.The text was updated successfully, but these errors were encountered: