3.2.0
Summary
In this release we added new logging features including ExtraKeys for temporary key management within scopes, an Enabled property for LogBuffering configuration, and TenantId support for Lambda Tenant Isolation observability. We also fixed a stdout file descriptor leak in the logging utility and an idempotency key collision issue when using multiple idempotent methods.
Thank you @jihed-garaouch for your first contribution ⭐
What's New
✨ ExtraKeys for Logger
| Docs
Added ExtraKeys() method to Logger for temporary key management within scopes. Keys are automatically cleaned up when the scope exits, with full support for async/await boundaries using AsyncLocal-based scope storage. Supports multiple overloads: Dictionary, params tuples, and nested scopes.
Dictionary syntax:
using (Logger.ExtraKeys(new Dictionary<string, object> { {"orderId", "123"} }))
{
Logger.LogInformation("Processing order"); // includes orderId
}
// orderId is automatically removedTuple syntax:
using (Logger.ExtraKeys(("orderId", "123"), ("customerId", "456")))
{
Logger.LogInformation("Processing"); // includes orderId and customerId
}✨ LogBuffering Enabled Property
| Docs
Added Enabled property to LogBufferingOptions to explicitly control log buffering activation. This allows configuring log buffering through property assignment instead of requiring constructor parameters.
var builder = new LoggerConfiguration();
builder.LogBuffering.Enabled = true;
builder.LogBuffering.BufferAtLogLevel = LogLevel.Debug;✨ TenantId Support
Added TenantId from ILambdaContext to the default logger properties to support AWS Lambda Tenant Isolation observability. When using Lambda Tenant Isolation, the TenantId is automatically captured and included in your structured log output.
{
"Level": "Information",
"Message": "Processing request",
"TenantId": "tenant-abc-123",
...
}🐛 Stdout File Descriptor Leak Fix
Fixed a file descriptor leak in ConsoleWrapper where OverrideLambdaLogger() was creating a new StreamWriter(Console.OpenStandardOutput()) on every log write, leaking one pipe file descriptor per call. Under sustained load in warm Lambda containers this exhausted the 1024 FD limit and crashed the function with "Too many open files". The stdout stream is now opened once and reused.
🐛 Idempotency Key Collision Fix
Fixed an issue where multiple idempotent methods with the same key would share the same idempotency record. The persistence store now uses AsyncLocal for the full function name, correctly isolating keys per method.
// Before: both methods would generate the same idempotency key
// After: each method generates a unique key based on the full function name
[Idempotent]
public Task<Response> MethodA(string key) { ... }
[Idempotent]
public Task<Response> MethodB(string key) { ... }Changes
🌟New features and non-breaking changes
- feat(logging): add ExtraKeys to logger (#1128) by @hjgraca
- feat(logging): add Enabled property to LogBuffering configuration (#1125) by @hjgraca
- feat: add TenantId to default logger properties (#1113) by @jihed-garaouch
📜 Documentation updates
- chore(deps): bump markdown from 3.7 to 3.8.1 in /docs (#1144) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
3bba0a9to8f41b60in /docs (#1141) by @dependabot[bot] - feat(logging): add ExtraKeys to logger (#1128) by @hjgraca
- feat(logging): add Enabled property to LogBuffering configuration (#1125) by @hjgraca
🐛 Bug and hot fixes
- fix(logging): prevent stdout file descriptor leak in ConsoleWrapper (#1148) by @hjgraca
- fix(idempotency): ensure unique idempotency keys for multiple methods with same key (#1124) by @hjgraca
🔧 Maintenance
- chore: Bump version from 3.1.0 to 3.2.0 (#1151) by @hjgraca
- chore(deps): bump markdown from 3.7 to 3.8.1 (#1149) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 6.2.0 to 6.3.0 (#1146) by @dependabot[bot]
- chore(deps): bump markdown from 3.7 to 3.8.1 in /docs (#1144) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.32.3 to 4.32.6 (#1145) by @dependabot[bot]
- chore(deps): bump aws-cdk from 2.1104.0 to 2.1108.0 in the aws-cdk group across 1 directory (#1142) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
3bba0a9to8f41b60in /docs (#1141) by @dependabot[bot] - chore(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0 (#1139) by @dependabot[bot]
- chore(deps): bump actions/download-artifact from 7.0.0 to 8.0.0 (#1138) by @dependabot[bot]
- chore(deps): bump actions/setup-node from 6.2.0 to 6.3.0 (#1147) by @dependabot[bot]
- chore: fix workflow security alerts (#1136) by @dreamorosi
- chore: fix npm security vulnerabilities (#1135) by @dreamorosi
- chore(deps): bump github/codeql-action from 4.31.10 to 4.32.3 (#1132) by @dependabot[bot]
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 4.0.1 to 5.0.0 (#1131) by @dependabot[bot]
- chore(deps): bump aws-actions/configure-aws-credentials from 5.1.1 to 6.0.0 (#1129) by @dependabot[bot]
- chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#1127) by @dependabot[bot]
- chore(deps): bump minimatch and aws-cdk-lib in /examples/Event Handler/BedrockAgentFunction/infra (#1133) by @dependabot[bot]
- chore(deps): bump actions/setup-python from 6.1.0 to 6.2.0 (#1121) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 6.1.0 to 6.2.0 (#1122) by @dependabot[bot]
- chore(deps): bump actions/checkout from 6.0.1 to 6.0.2 (#1120) by @dependabot[bot]
- chore(deps): bump peter-evans/create-pull-request from 8.0.0 to 8.1.0 (#1119) by @dependabot[bot]
- chore(deps): bump actions/setup-node from 6.1.0 to 6.2.0 (#1114) by @dependabot[bot]
- chore(deps): bump actions/setup-dotnet from 5.0.1 to 5.1.0 (#1115) by @dependabot[bot]
- chore(deps): bump github/codeql-action from 4.31.9 to 4.31.10 (#1116) by @dependabot[bot]
- chore(deps): bump urllib3 from 2.6.0 to 2.6.3 (#1112) by @dependabot[bot]
This release was made possible by the following contributors:
@dependabot[bot], @dreamorosi, @hjgraca, @jihed-garaouch and dependabot[bot]