-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new nestedKey config to avoid property name collisions with pino standard properties when logging objects #759
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! I left a nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good addition, just have some change requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@davidmarkclements are you good with this now? |
yes |
released https://github.com/pinojs/pino/releases/tag/v5.16.0 thank you @matthewadams |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Some people log objects a lot. Those objects, in general, may have properties that conflict with pino's standard logging fields (
level
,v
,pid
, etc). Also, when searching logs for logged objects, it's nice to always have them in a consistent location (that is, property of the root log record object).This PR adds a new config option
objectKey
nestedKey
that causes log records to include a key whose name is the value of theobjectKey
nestedKey
config, and whose value is the logged object (if it is an object and not a string). It allows folks using things like Kibana, StackDriver, MongoDB, etc, to consistently know the path in their log records to search for, and guarantees that no logged object's properties will conflict with pino's standard properties.