observability

How to do logging in .NET AWS Lambda functions

Lester Sanchez
This article discusses four different ways of sending logs to Cloudwatch from a Lambda function implemented in .NET. Using ILambdaContext.Logger The ILambdaLogger is the most limited option, but it is also the only one readily available in the lambda without requiring any configuration. It just writes messages in one line, without any specific structure. There is no support to add exceptions when logging errors, or using message template with parameters. This is a good option for a very basic logging needs.