Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/core/logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ When debugging in non-production environments, you can instruct Logger to log th

You can set a Correlation ID using `correlation_id_path` param by passing a [JMESPath expression](https://jmespath.org/tutorial.html){target="_blank"}.

!!! tip "You can retrieve correlation IDs via `get_correlation_id` method"

=== "collect.py"

```python hl_lines="5"
Expand All @@ -155,6 +157,7 @@ You can set a Correlation ID using `correlation_id_path` param by passing a [JME

@logger.inject_lambda_context(correlation_id_path="headers.my_request_id_header")
def handler(event, context):
logger.debug(f"Correlation ID => {logger.get_correlation_id()}")
logger.info("Collecting payment")
```

Expand Down Expand Up @@ -198,6 +201,7 @@ We provide [built-in JMESPath expressions](#built-in-correlation-id-expressions)

@logger.inject_lambda_context(correlation_id_path=correlation_paths.API_GATEWAY_REST)
def handler(event, context):
logger.debug(f"Correlation ID => {logger.get_correlation_id()}")
logger.info("Collecting payment")
```

Expand Down