Skip to content

Commit 3b4f5ee

Browse files
committed
initial commit, add getting started to docs. update mkdocs and menu navigation
1 parent e9550ff commit 3b4f5ee

File tree

16 files changed

+444
-37
lines changed

16 files changed

+444
-37
lines changed

docs/core/logging-v2.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Logging V2
2+
title: Logging v2
33
description: Core utility
44
---
55

@@ -25,6 +25,14 @@ The logging utility provides a Lambda optimized logger with output structured as
2525
interface
2626
* Support for message templates `{}` and `{@}` for structured logging
2727

28+
## Breaking changes from v1 (dependency updates)
29+
30+
| Change | Before (v1.x) | After (v2.0) | Migration Action |
31+
|--------|---------------|--------------|-----------------|
32+
| Amazon.Lambda.Core | 2.2.0|2.5.0 | dotnet add package Amazon.Lambda.Core |
33+
| Amazon.Lambda.Serialization.SystemTextJson | 2.4.3 | 2.4.4 | dotnet add package Amazon.Lambda.Serialization.SystemTextJson |
34+
| Microsoft.Extensions.DependencyInjection | 8.0.0 | 8.0.1 | dotnet add package Microsoft.Extensions.DependencyInjection |
35+
2836
## Installation
2937

3038
Powertools for AWS Lambda (.NET) are available as NuGet packages. You can install the packages
@@ -1467,10 +1475,13 @@ You can change where the `Logger` will output its logs by setting the `LogOutput
14671475
We also provide a helper class for tests `TestLoggerOutput` or you can provider your own implementation of `IConsoleWrapper`.
14681476

14691477
```csharp
1470-
// Using TestLoggerOutput
1471-
options.LogOutput = new TestLoggerOutput();
1472-
// Custom console output for testing
1473-
options.LogOutput = new TestConsoleWrapper();
1478+
Logger.Configure(options =>
1479+
{
1480+
// Using TestLoggerOutput
1481+
options.LogOutput = new TestLoggerOutput();
1482+
// Custom console output for testing
1483+
options.LogOutput = new TestConsoleWrapper();
1484+
});
14741485

14751486
// Example implementation for testing:
14761487
public class TestConsoleWrapper : IConsoleWrapper
@@ -1483,6 +1494,32 @@ public class TestConsoleWrapper : IConsoleWrapper
14831494
}
14841495
}
14851496
```
1497+
```csharp
1498+
// Test example
1499+
[Fact]
1500+
public void When_Setting_Service_Should_Update_Key()
1501+
{
1502+
// Arrange
1503+
var consoleOut = new TestLoggerOutput();
1504+
Logger.Configure(options =>
1505+
{
1506+
options.LogOutput = consoleOut;
1507+
});
1508+
1509+
// Act
1510+
_testHandlers.HandlerService();
1511+
1512+
// Assert
1513+
1514+
var st = consoleOut.ToString();
1515+
1516+
Assert.Contains("\"level\":\"Information\"", st);
1517+
Assert.Contains("\"service\":\"test\"", st);
1518+
Assert.Contains("\"name\":\"AWS.Lambda.Powertools.Logging.Logger\"", st);
1519+
Assert.Contains("\"message\":\"test\"", st);
1520+
}
1521+
```
1522+
14861523
### ILogger
14871524

14881525
If you are using ILogger interface you can inject the logger in a dedicated constructor for your Lambda function and thus you can mock your ILogger instance.

docs/core/logging.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
---
2-
title: Logging
2+
title: Logging v1
33
description: Core utility
44
---
55

6+
!!! warning
7+
Version 1.x.x will continue to be supported until **end of July 2025** for critical bug fixes and security updates in very exceptional cases where you cannot update to v2, but no new features will be added to this version.
8+
9+
We recommend you upgrade to the latest version.
10+
11+
The latest version is available at [Logging v2](https://docs.powertools.aws.dev/lambda/dotnet/core/logging-v2/).
12+
13+
614
The logging utility provides a Lambda optimized logger with output structured as JSON.
715

16+
817
## Key features
918

1019
* Capture key fields from Lambda context, cold start and structures logging output as JSON

docs/core/metrics.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
---
2-
title: Metrics
2+
title: Metrics v1
33
description: Core utility
44
---
55

6+
!!! warning
7+
Version 1.x.x will continue to be supported **until end of October 2025** for bug fixes and security updates, but no new features will be added to this version. We recommend you upgrade to the latest version.
8+
9+
The latest version is available at [Metrics v2](https://docs.powertools.aws.dev/lambda/dotnet/core/metrics-v2/).
10+
11+
612
Metrics creates custom metrics asynchronously by logging metrics to standard output following [Amazon CloudWatch Embedded Metric Format (EMF)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format.html).
713

814
These metrics can be visualized through [Amazon CloudWatch Console](https://aws.amazon.com/cloudwatch/).

docs/getting-started/idempotency/aot.md

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Simple Logging
3+
description: Getting started with Logging
4+
---

docs/getting-started/logger/aot.md

Whitespace-only changes.

docs/getting-started/logger/aspnet.md

Whitespace-only changes.

0 commit comments

Comments
 (0)