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
Debug network requests without logs is an another art form. Most likely you won't be able to say what happened here, because you or your colleague forgot to add enough debug information. Also network requests can have retries due to network or service problems that will not be displayed in the logs. This is critical problem in teams that work with automated app releases, money, or large and complex processes.
Goals
Logging (injectable logger) of each stage of the network request lifecycle.
request
response
redirect
retry-planned
retry-skipped
Ability to log parts of request
showQueryFields (boolean | string[]) — to control the display of Query parameters
hideQueryFields (string[]) — to hide some specific Query parameters like token or something else
showPayloadFields (boolean | string[]) — to control the display of Payload fields only for JSON payload type
hidePayloadFields (string[]) — to hide some specific Payload fields
truncateResponseBodyAfter (number) — to limit the message length for failed requests in log
requestId (string) — ability to set custom request id (used for x-request-id)
...
Mark each request by x-request-id header. The request id does not change during a single request lifecycle (request → response → retry-planned → …).
Provide an ability to control retires by function.
Details
Based on got. Fully compatible API without additional hacks. At least for now.
{"type": "response","id": "c781e1c2a07805a3f7f359473a85adaf","method": "GET","url": "https://canonium.com/pathname","status": 404,"message": "Not Found","code": "ENOTFOUND",// For network problems"body": "Some text of the response that can be truncated by limit<truncated>"}
{"type": "retry-skipped","id": "c781e1c2a07805a3f7f359473a85adaf","method": "GET","url": "https://canonium.com/pathname","reason": "Skipped due to non-retriable status code: 404",// Something else?}
The text was updated successfully, but these errors were encountered:
Description
Library for working with network requests.
Motivation
Debug network requests without logs is an another art form. Most likely you won't be able to say what happened here, because you or your colleague forgot to add enough debug information. Also network requests can have retries due to network or service problems that will not be displayed in the logs. This is critical problem in teams that work with automated app releases, money, or large and complex processes.
Goals
request
response
redirect
retry-planned
retry-skipped
showQueryFields
(boolean | string[]
) — to control the display of Query parametershideQueryFields
(string[]
) — to hide some specific Query parameters liketoken
or something elseshowPayloadFields
(boolean | string[]
) — to control the display of Payload fields only for JSON payload typehidePayloadFields
(string[]
) — to hide some specific Payload fieldstruncateResponseBodyAfter
(number
) — to limit the message length for failed requests in logrequestId
(string
) — ability to set custom request id (used forx-request-id
)x-request-id
header. The request id does not change during a single request lifecycle (request
→response
→retry-planned
→ …).Details
Based on
got
. Fully compatible API without additional hacks. At least for now.Log
GET request
GET redirect
POST request
GET response
GET retry-planned
GET retry-skipped
The text was updated successfully, but these errors were encountered: