Skip to content

Commit 8d25d2e

Browse files
author
Piotr Karpala
committed
Including EventId and Exception in LambdaLogger messages
1 parent 23666e7 commit 8d25d2e

5 files changed

Lines changed: 376 additions & 259 deletions

File tree

Libraries/src/Amazon.Lambda.Logging.AspNetCore/LambdaLoggerOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class LambdaLoggerOptions
1717
private const string INCLUDE_LOG_LEVEL_KEY = "IncludeLogLevel";
1818
private const string INCLUDE_CATEGORY_KEY = "IncludeCategory";
1919
private const string INCLUDE_NEWLINE_KEY = "IncludeNewline";
20-
private const string INCLUDE_EXCEPTION = "IncludeException";
21-
private const string INCLUDE_EVENT_ID = "IncludeEventId";
20+
private const string INCLUDE_EXCEPTION_KEY = "IncludeException";
21+
private const string INCLUDE_EVENT_ID_KEY = "IncludeEventId";
2222
private const string LOG_LEVEL_KEY = "LogLevel";
2323

2424
/// <summary>
@@ -128,12 +128,12 @@ public LambdaLoggerOptions(IConfiguration configuration, string loggingSectionNa
128128
IncludeLogLevel = bool.Parse(includeLogLevelString);
129129
}
130130

131-
if (TryGetString(loggerConfiguration, INCLUDE_EXCEPTION, out string includeExceptionString))
131+
if (TryGetString(loggerConfiguration, INCLUDE_EXCEPTION_KEY, out string includeExceptionString))
132132
{
133133
IncludeException = bool.Parse(includeExceptionString);
134134
}
135135

136-
if (TryGetString(loggerConfiguration, INCLUDE_EVENT_ID, out string includeEventIdString))
136+
if (TryGetString(loggerConfiguration, INCLUDE_EVENT_ID_KEY, out string includeEventIdString))
137137
{
138138
IncludeEventId = bool.Parse(includeEventIdString);
139139
}

Libraries/test/Amazon.Lambda.Logging.AspNetCore.Tests/Amazon.Lambda.Logging.AspNetCore.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12+
<None Update="appsettings.exceptions.json">
13+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
14+
</None>
1215
<None Update="appsettings.wildcard.json">
1316
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1417
</None>

0 commit comments

Comments
 (0)