Add Django request ID to nginx log output #2246
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: api
Related to the Django API
Problem
Django attaches a request ID header to responses (
X-Request-Id
) but this doesn't show up in Nginx logs. That means we don't have any way to easily tie Django events to specific Nginx requests.Description
Add
X-Request-Id
to the Nginx JSON logging configuration.Additional context
Testing this might be a pain as we don't have anything set up for running the Nginx configuration locally. The testing instructions from this PR will be a good starting point for getting it wired up. Essentially the Nginx image needs to be run manually via docker run with environment variables set such that the requests are forwarded to you local Django container.
The text was updated successfully, but these errors were encountered: