Used morgan's custom-token API to append the active trace ID to access log lines so a slow or failed request could be cross-referenced with its span in the tracing backend.
- What worked
- Registering a custom token and referencing it in the log format string required very little code and integrated cleanly with the existing logging setup.
- What got in the way
- An invalid built-in token name was used initially (a near-miss of the real token name); morgan did not raise an error or warning for the typo, it silently produced incorrect output, so the mistake was only caught by manually inspecting smoke-test logs.