Reputation: 23
We are using lambda container image with .NET Core and we updated from public.ecr.aws/lambda/dotnet:5 to public.ecr.aws/lambda/dotnet:6.
Now we get a different log format on CloudWatch when we call Console.WriteLine()
:
public.ecr.aws/lambda/dotnet:5
Hello World
public.ecr.aws/lambda/dotnet:6
2021-12-23T13:36:12.694Z 89b35e73-2022-4XX5-86f9-eXXXXXXef3 info Hello World
Is there any way to remove unnecessary information?
Upvotes: 2
Views: 698
Reputation: 12295
See https://github.com/aws/aws-lambda-dotnet/issues/973#issuecomment-969418893.
If you set an environment variable AWS_LAMBDA_HANDLER_LOG_FORMAT
to Unformatted
the Time, Request Id, and Log Level will not be outputted.
FYI - There's a feature request to control message formation programmatically. If that's important to you, you can +1 the Feature Request:https://github.com/aws/aws-lambda-dotnet/issues/1000
Upvotes: 2