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
Copy file name to clipboardExpand all lines: docs/core/logger.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,7 @@ We provide [built-in JMESPath expressions](#built-in-correlation-id-expressions)
232
232
### Appending additional keys
233
233
234
234
!!! info "Custom keys are persisted across warm invocations"
235
-
Always set additional keys as part of your handler to ensure they have the latest value, or explicitly clear them with `remove_custom_keys=True`as explained above.
235
+
Always set additional keys as part of your handler to ensure they have the latest value, or explicitly clear them with `clear_state=True`as explained above.
236
236
237
237
238
238
You can append additional keys using either mechanism:
@@ -427,17 +427,17 @@ You can remove any additional key from Logger state using `remove_keys`.
427
427
}
428
428
```
429
429
430
-
#### Removing all custom keys
430
+
#### Clearing all state
431
431
432
-
Logger is commonly initialized in the global scope. Due to [Lambda Execution Context reuse](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html), this means that custom keys can be persisted across invocations. If you want all custom keys to be deleted, you can use `remove_custom_keys=True` param in `inject_lambda_context` decorator.
432
+
Logger is commonly initialized in the global scope. Due to [Lambda Execution Context reuse](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html), this means that custom keys can be persisted across invocations. If you want all custom keys to be deleted, you can use `clear_state=True` param in `inject_lambda_context` decorator.
433
433
434
434
!!! info
435
435
This is useful when you add multiple custom keys conditionally, instead of setting a default `None` value if not present. Any key with `None` value is automatically removed by Logger.
436
436
437
437
!!! danger "This can have unintended side effects if you use Layers"
438
438
Lambda Layers code is imported before the Lambda handler.
439
439
440
-
This means that `remove_custom_keys=True` will instruct Logger to remove any keys previously added before Lambda handler execution proceeds.
440
+
This means that `clear_state=True` will instruct Logger to remove any keys previously added before Lambda handler execution proceeds.
441
441
442
442
You can either avoid running any code as part of Lambda Layers global scope, or override keys with their latest value as part of handler's execution.
443
443
@@ -448,7 +448,7 @@ Logger is commonly initialized in the global scope. Due to [Lambda Execution Con
0 commit comments