hapijs / hapijs/hapi-pino

Logging information from user credentials

Open
#128 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
147
Forks
56
PR merge metrics
No merged PRs in 30d

Description

It's useful for me to be able to access a user's ID or email address when investigating errors reported from our Hapi project. This metadata is in Hapi's `request.auth.credentials` object, so using `hapi-pino` I can access that information for request logs with a custom serializer since they include the `req` object. However, for error logs, the `req` object does not seem to be included at all.

The easiest fix would be to simply include the `req` object with errors... but I also wonder if anyone has ideas about logging the `credentials` object across the board? A lot of logging/issue tracking services like Sentry have first class support for tracking users like this and it'd be nice for this to "just work" without messing around with the `req` serializer.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.