Node.js · Middle · Question 60 of 75
Why should logs include a request ID?
- ✓Correct answer: To find all log lines of one request, even across several services
- 2To make logs shorter
- 3Because log systems reject lines without IDs
Explanation
Generate or accept a request ID, pass it to downstream calls in a header and add it to every log line, for example with AsyncLocalStorage.