Skip to content

docs(event_handler): use correct correlation_id for logger in middleware example #3063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def inject_correlation_id(app: APIGatewayRestResolver, next_middleware: NextMidd

# Inject correlation ID in shared context and Logger
app.append_context(correlation_id=correlation_id) # (2)!
logger.set_correlation_id(request_id)
logger.set_correlation_id(correlation_id)

# Get response from next middleware OR /todos route
result = next_middleware(app) # (3)!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def inject_correlation_id(app: APIGatewayRestResolver, next_middleware: NextMidd

# Inject correlation ID in shared context and Logger
app.append_context(correlation_id=correlation_id)
logger.set_correlation_id(request_id)
logger.set_correlation_id(correlation_id)

# Get response from next middleware OR /todos route
result = next_middleware(app)
Expand Down