You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**What's the difference between `append_keys` and `extra`?**
607
+
### How can I add standard library logging attributes to a log record?
608
+
609
+
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.
610
+
611
+
You can include any of these logging attributes as key value arguments (`kwargs`) when instantiating `Logger` or `LambdaPowertoolsFormatter`.
612
+
613
+
You can also add them later anywhere in your code with `append_keys`, or remove them with `remove_keys` methods.
For log records originating from Powertools Logger, the `name` attribute will be the same as `service`, for log records coming from standard library logger, it will be the name of the logger (i.e. what was used as name argument to `logging.getLogger`).
627
+
628
+
### What's the difference between `append_keys` and `extra`?
608
629
609
630
Keys added with `append_keys` will persist across multiple log messages while keys added via `extra` will only be available in a given log message operation.
610
631
@@ -622,6 +643,6 @@ Here's an example where we persist `payment_id` not `request_id`. Note that `pay
**How do I aggregate and search Powertools logs across accounts?**
646
+
### How do I aggregate and search Powertools logs across accounts?
626
647
627
648
As of now, ElasticSearch (ELK) or 3rd party solutions are best suited to this task. Please refer to this [discussion for more details](https://github.com/awslabs/aws-lambda-powertools-python/issues/460)
0 commit comments