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. |
heitorlessa
left a comment
There was a problem hiding this comment.
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 <heitor.lessa@hotmail.com>
Co-authored-by: Heitor Lessa <heitor.lessa@hotmail.com>
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.
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.
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.
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.
For example, here Logger is more explicit in intent than Logger.
Co-authored-by: Heitor Lessa <heitor.lessa@hotmail.com>
|
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
Loggercan 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