request-promise-lite icon indicating copy to clipboard operation
request-promise-lite copied to clipboard

Provide request id in log output

Open medikoo opened this issue 7 years ago • 4 comments

There are situations where many requests are run in parallel, then log output may become unclear on which logs refer to which request (especially when we deal with errors).

This patch ensures that logs of specific request can easily be recognized.

medikoo avatar Jan 19 '18 14:01 medikoo

Coverage Status

Coverage increased (+0.02%) to 97.81% when pulling 254f1ff2738bfd664801d69015a3e5258fd7339b on medikoo:request-ids-in-logs into 2d50c8ab09c93591e81a1f45229735be4fcca58f on laurisvan:master.

coveralls avatar Jan 19 '18 14:01 coveralls

This one is interesting - indeed the requests might get entangled. I wonder if there were a way to inject case specific needs into the logs etc.

While there's nothing wrong in this one, I wonder if this will open Pandora's box for appending just about everything case-by-case to the requests...

Let me elaborate a bit on this one and get back to you shortly.

laurisvan avatar Mar 13 '18 15:03 laurisvan

In MaaS projects we had cases where it's difficult to clearly deduct what comes from which requests, and it made debugging additionally cumbersome.

medikoo avatar Mar 13 '18 16:03 medikoo

Here is an example of logs where it's no upfront clear what responses match what requests:

https://eu-west-1.console.aws.amazon.com/cloudwatch/home?region=eu-west-1#logEventViewer:group=/aws/lambda/maas-tsp-beta-booking-taxi-munich;stream=2018/03/20/%5B$LATEST%5Ddacd37fce90b42c48d6844ebe72f1786

Missing that information unfortunately increases debugging time on our side.

medikoo avatar Apr 05 '18 11:04 medikoo