Is there a way to include `request.route.path` in the log?
- Dominant language
- JavaScript
- Stars
- 147
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
### Runtime
node.js
### Runtime version
v18.20.4
### Module version
12.1.0
### Used with
hapi
### Any other relevant information
_No response_
### How can we help?
Is there a way to attach the route path to the log object? If not I can always place another hook on hapi to properly set the bindings before the hapi-pino on response hook is called, but that feels like a bit of a hack. If it's not supported, would it be acceptable to add either a callback for producing the object(along the lines of `customRequestCompleteMessage`) or with extending [the object creation](https://github.com/hapijs/hapi-pino/blob/b6255430de385661ab7223fd3e44d42945cbecbe/index.js#L188) to support the route path?
The motivation for this is to simplify log aggregation.
Contributor guide
Research direction
Start with index.js around line 188, where the issue identifies the object creation being considered for extension. Determine whether the hapi route path can be exposed through the existing logging flow or needs a new callback, then define the supported behavior and how it should be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100