Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 3.31 KB

File metadata and controls

56 lines (44 loc) · 3.31 KB

Tips for troubleshooting Lambda functions

If your Lambda function is not working as expected here are some tips to help understand what is going on.

CloudWatch Logs

In .NET Core Lambda functions all calls to ILambdaContext.Logger.LogLine as well as all Console.Write calls will be captured by the Lambda service and recorded into CloudWatch Logs. The Log Group assigned to the Lambda function will follow the pattern /aws/lambda/<function-name>.

If you are using the AWS Toolkit for Visual Studio then from the function view you can view logs from the Logs tab. Push on the green download button to view the logs. There is a few seconds delay from when the .NET code in the Lambda function write the log message to when it will show up in this view. If you don't see the expected messages keep pushing the Refresh button.

alt text

Replaying events in Visual Studio

The AWS .NET Mock Lambda Test Tool allows you to replay events with a .NET debugger attached. For Visual Studio users this tool will automatically be configured for Lambda projects when they are opened. For other .NET IDEs, like Visual Studio for Code, checkout the README.md for instructions on how to configure the tool for it.

To capture the Lambda JSON event object so that it can be replayed locally, redeploy the Lambda function with the LAMBDA_NET_SERIALIZER_DEBUG environment variable set to true. Once this environment variable is set the JSON event will be written to the CloudWatch Log. Copy the event from the log and past it into the Function Input text box and push Execute Function.


Continue on to next page: Stream processing wrap up