Open
Conversation
added 10 commits
February 12, 2026 15:53
33 tasks
added 3 commits
February 12, 2026 21:05
…eLogger() instead of the raw logger parameter
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements JSON structured logging support for AWS Lambda functions, aligning with AWS Lambda's advanced logging controls. The implementation adds the ability to emit logs in JSON format when AWS_LAMBDA_LOG_FORMAT=JSON is set, while maintaining full backward compatibility with existing text-based logging.
Changes:
- Introduces
LoggingConfigurationto handle environment variable parsing and logger factory logic with proper precedence rules forAWS_LAMBDA_LOG_LEVELvsLOG_LEVEL - Adds
JSONLogHandlerto format logs as JSON with Lambda-specific metadata (requestId, traceId) - Updates
LambdaRuntimeandLambdaManagedRuntimeto use the new logging configuration and create per-request loggers - Provides comprehensive JSONLogging example with deployment templates and documentation
- Updates design proposal and other documentation
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/AWSLambdaRuntime/Logging/LoggingConfiguration.swift | New file implementing logging configuration with environment variable parsing and logger factory methods |
| Sources/AWSLambdaRuntime/Logging/JSONLogHandler.swift | New file implementing JSON log handler with structured output to stderr |
| Sources/AWSLambdaRuntime/Runtime/LambdaRuntime.swift | Updated to initialize and use LoggingConfiguration, create per-request loggers |
| Sources/AWSLambdaRuntime/ManagedRuntime/LambdaManagedRuntime.swift | Updated to initialize and use LoggingConfiguration, create per-request loggers |
| Sources/AWSLambdaRuntime/Lambda.swift | Updated runLoop to create per-request loggers, deprecated old runLoop signature |
| Tests/AWSLambdaRuntimeTests/LambdaRunLoopTests.swift | Updated tests to use new runLoop signature with LoggingConfiguration |
| Sources/AWSLambdaRuntime/Docs.docc/Proposals/0002-logging.md | New design document describing the structured logging feature |
| Sources/AWSLambdaRuntime/Docs.docc/managed-instances.md | Header level adjustments for consistency |
| Sources/AWSLambdaRuntime/Docs.docc/Deployment.md | Header level adjustment for consistency |
| Examples/JSONLogging/* | Complete example demonstrating JSON logging with SAM templates and README |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sources/AWSLambdaRuntime/ManagedRuntime/LambdaManagedRuntime.swift
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for Structured Logging, as per the design document