-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
When I'm searching a log file, usually I'm interested in several events that happened during the same request handler. Could we add a unique "request ID" to tie these together?
This would be different than the existing "ctx" field, which lets you separate events from different threads, but not from different requests.
I imagine the implementation would be something like:
- keep a process-global counter for generating unique IDs
- add an optional<int> currentRequestId to something (Client? RequestExecutionContext?)
- when we start handling a request (same place we log "About to run"?), update currentRequestId with a fresh ID
- look up currentRequestId when we populate log attributes, just like "ctx"
- clear currentRequestId after we send the response