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
fix(event_handler): sync alias and validation_alias for Pydantic 2.12+ compatibility (aws-powertools#7901)
* fix: add support for Pydantic 2.12+
* fix: add support for Pydantic 2.12+
* fix: add support for Pydantic 2.12+
* fix: add support for Pydantic 2.12+
Copy file name to clipboardExpand all lines: docs/core/logger.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -196,18 +196,18 @@ You can append your own keys to your existing Logger via `append_keys(**addition
196
196
The append_context_keys method allows temporary modification of a Logger instance's context without creating a new logger. It's useful for adding context keys to specific workflows while maintaining the logger's overall state and simplicity.
197
197
198
198
???+ danger "Important: Keys are removed on context exit, even if they existed before"
199
-
All keys added within the context are removed when exiting, **including keys that already existed with the same name**.
200
-
199
+
All keys added within the context are removed when exiting, **including keys that already existed with the same name**.
200
+
201
201
If you need to temporarily override a key's value while preserving the original, use `append_keys()` for persistent keys and avoid key name collisions with `append_context_keys()`.
logger.info("Order received") # Has order_id="ORD-123"
207
-
207
+
208
208
with logger.append_context_keys(order_id="ORD-CHILD"): # Overwrites
209
209
logger.info("Processing") # Has order_id="ORD-CHILD"
210
-
210
+
211
211
logger.info("Order completed") # order_id key is now MISSING!
212
212
```
213
213
@@ -1014,7 +1014,7 @@ You can change the order of [standard Logger keys](#standard-structured-keys) or
1014
1014
By default, this Logger and the standard logging library emit records with the default AWS Lambda timestamp in **UTC**.
1015
1015
1016
1016
<!-- markdownlint-disable MD013 -->
1017
-
If you prefer to log in a specific timezone, you can configure it by setting the `TZ` environment variable. You can do this either as an AWS Lambda environment variable or directly within your Lambda function settings. [Click here](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime){target="_blank"} for a comprehensive list of available Lambda environment variables.
1017
+
If you prefer to log in a specific timezone, you can configure it by setting the `TZ` environment variable. You can do this either as an AWS Lambda environment variable or directly within your Lambda function settings. See the [Lambda environment variables documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime){target="_blank"} for a comprehensive list of available options.
0 commit comments