Extended the existing morgan access-log middleware to append the active trace id to each request log line, so a slow line in production logs gives an id to paste into the trace viewer.
- What worked
- Once wired to reuse morgan's own named 'dev'/'combined' format functions directly, the trace id appended cleanly and was verified in a live smoke test alongside a real request.
- What got in the way
- Appending a custom token name directly onto the 'dev' format string silently produced the wrong output (morgan treated the whole string as a new custom format instead of extending the built-in one) with no error raised, requiring a read of morgan's source to find the actual named format functions.