Skip to content

Commit b1e2f99

Browse files
Addressing Andrea's feedback
1 parent 46fc1df commit b1e2f99

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

docs/core/logger.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ Log buffering enables you to buffer logs for a specific request or invocation. E
522522

523523
=== "getting_started_with_buffering_logs.py"
524524

525-
```python hl_lines="5 8"
525+
```python hl_lines="5 6 15"
526526
--8<-- "examples/logger/src/getting_started_with_buffering_logs.py"
527527
```
528528

@@ -538,24 +538,26 @@ When configuring log buffering, you have options to fine-tune how logs are captu
538538

539539
=== "working_with_buffering_logs_different_levels.py"
540540

541-
```python hl_lines="5 8"
541+
```python hl_lines="5 6 10-12"
542542
--8<-- "examples/logger/src/working_with_buffering_logs_different_levels.py"
543543
```
544544

545+
1. Setting `minimum_log_level="WARNING"` configures log buffering for `WARNING` and lower severity levels (`INFO`, `DEBUG`).
546+
545547
=== "working_with_buffering_logs_disable_on_error.py"
546548

547-
```python hl_lines="5 8"
549+
```python hl_lines="5 6 14 21 24"
548550
--8<-- "examples/logger/src/working_with_buffering_logs_disable_on_error.py"
549551
```
550552

551553
#### Flushing on exceptions
552554

553555
Use the `@logger.inject_lambda_context` decorator to automatically flush buffered logs when an exception is raised in your Lambda function. The `flush_buffer_on_uncaught_error` parameter captures and flush all buffered logs records before the Lambda execution terminates.
554556

555-
=== "working_with_buffering_logs_uncaught_exception.py"
557+
=== "working_with_buffering_logs_when_raise_exception.py"
556558

557-
```python hl_lines="5 8"
558-
--8<-- "examples/logger/src/working_with_buffering_logs_uncaught_exception.py"
559+
```python hl_lines="5 6 13 19"
560+
--8<-- "examples/logger/src/working_with_buffering_logs_when_raise_exception.py"
559561
```
560562

561563
#### Reutilizing same buffer instance

examples/logger/src/working_with_buffering_logs_different_levels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from aws_lambda_powertools.logging.buffer import LoggerBufferConfig
33
from aws_lambda_powertools.utilities.typing import LambdaContext
44

5-
logger_buffer_config = LoggerBufferConfig(minimum_log_level="WARNING")
5+
logger_buffer_config = LoggerBufferConfig(minimum_log_level="WARNING") # (1)!
66
logger = Logger(level="INFO", logger_buffer=logger_buffer_config)
77

88

0 commit comments

Comments
 (0)