-
Notifications
You must be signed in to change notification settings - Fork 475
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
Using Amazon.Lambda.Core 2.4.0 breaks running locally with Amazon.Lambda.TestTool-8.0 0.15.3 #1869
Comments
Issue reproducible using Lambda Test Tool 8.0 version using Amazon.Lambda.Core;
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]
namespace TestNet8Lambda;
public class Function
{
public string FunctionHandler(string input, ILambdaContext context)
{
context.Logger.LogInformation("Input is: {input}", input);
return input.ToUpper();
}
} .csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
<!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Generate ready to run images during publishing to improve cold start time. -->
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.4.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4" />
</ItemGroup>
</Project>
@thomaswr Please confirm if it was working with previous version |
It works with Amazon.Lambda.Core 2.3.0, if not using structured logging.
|
Version |
Comments on closed issues are hard for our team to see. |
Describe the bug
I want to update Amazon.Lambda.Core in order to use JSON logging but this currently breaks running the lambda locally via LambdaTestTool.
Regression Issue
Expected Behavior
I want to update Amazon.Lambda.Core in order to use JSON logging but this currently breaks running the lambda locally via LambdaTestTool invokes lambda and I get JSON formatted as described in the blog post: https://aws.amazon.com/blogs/developer/structured-logging-for-net-lambda/
Current Behavior
Reproduction Steps
Implement Lambda using Amazon.Lambda.Core 2.4.0, making use of the ILambdaContext.Logger and using the second parameter of e.g.
LogInformation
.Example:
context.Logger.LogInformation("User name is: {user}", user);
Then run it with the LambdaTestTool
Possible Solution
Update Amazon.Lambda.Core Dependency in LambdaTestTool to 2.4.0
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Amazon.Lambda.TestTool-8.0 0.15.3
Targeted .NET Platform
.NET 8
Operating System and version
Ubuntu
The text was updated successfully, but these errors were encountered: