-
Notifications
You must be signed in to change notification settings - Fork 403
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
docs(logger): document enriching logs with logrecord attributes #1271
docs(logger): document enriching logs with logrecord attributes #1271
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
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.
These look great!! One minor change to stay on brand with Powertools
in capital, and one paragraph suggestion to ease reading.
Did you want me to fix this as well in this PR? (change to I went with Want me to fix that too here? 🙂 |
Ah, and one more thing, would you like a commit with changing |
Yes to all of them!!!! Thank you |
Co-authored-by: Heitor Lessa <[email protected]>
Co-authored-by: Heitor Lessa <[email protected]>
a261835
to
fe34e7a
Compare
**What's the difference between `append_keys` and `extra`?** | ||
### How can I add standard library logging attributes to a log record? | ||
|
||
The Python standard library log records contains a [large set of atttributes](https://docs.python.org/3/library/logging.html#logrecord-attributes){target="_blank"}, however only a few are included in Powertools Logger log record by default. |
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.
Nit, but.... "Powertools Logger
" instead of `Powertools Logger"?
The Python standard library log records contains a [large set of atttributes](https://docs.python.org/3/library/logging.html#logrecord-attributes){target="_blank"}, however only a few are included in Powertools Logger log record by default. | |
The Python standard library log records contains a [large set of atttributes](https://docs.python.org/3/library/logging.html#logrecord-attributes){target="_blank"}, however only a few are included in Powertools `Logger` log record by default. |
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 see why it'd make sense, but it'd be difficult to stay consistent over time - let's keep Powertools Logger. At least until we explore tools like Vale.
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.
Sounds good. I think this is ready to merge then.
|
||
The Python standard library log records contains a [large set of atttributes](https://docs.python.org/3/library/logging.html#logrecord-attributes){target="_blank"}, however only a few are included in Powertools Logger log record by default. | ||
|
||
You can include any of these logging attributes as key value arguments (`kwargs`) when instantiating `Logger` or `LambdaPowertoolsFormatter`. |
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.
For example, here Logger
is more explicit in intent than Logger.
Co-authored-by: Heitor Lessa <[email protected]>
Merging. Thank you so much again @kbakk. This will help a ton of customers coming from standard logging lib |
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Issue number: #1267
Summary
Document how users of the
Logger
can further enrich logsChanges
Add additional FAQ question/answer.
User experience
n/a
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.
View rendered docs/core/logger.md