Skip to content

Commit 95998c9

Browse files
committed
docs: clarify logger debug sampling message
1 parent e5982fa commit 95998c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: docs/content/core/logger.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,10 @@ def handler(event, context)
187187

188188
You can dynamically set a percentage of your logs to **DEBUG** level using `sample_rate` param or via env var `POWERTOOLS_LOGGER_SAMPLE_RATE`.
189189

190-
<Note type="warning">
191-
This is possible due to <a href="https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html">AWS Lambda reuse of execution context</a>, <strong>however, it is not always guaranteed.</strong>
190+
This happens on an entire request basis, and <strong>DEBUG</strong> level is set at the constructor. That means, concurrent requests or infrequent invocations are more likely to occur as [new Lambda execution contexts are created](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html), not reused.
191+
192+
<Note type="info">
193+
If you want this logic to happen on every invocation regardless whether Lambda reuses the execution environment or not, then create your Logger inside your Lambda handler.
192194
</Note><br/>
193195

194196
```python:title=collect.py

0 commit comments

Comments
 (0)