Add unique HTTP request ID to logs
Summary
Having a unique identifier for a HTTP request is a precious debugging tool.
There are some existing tools for this:
- Apache
UNIQUE_ID
- Nginx
$request_id
-
X-Request-ID
,X-Correlation-ID
etc.
Design proposition
- Extend the request object with a new
$req->request_id
field populated from one of the previously mentionned sources - Auto-generate a request_id if one isn't found
- Document how to easily enable
request_id
in logs