DEV Community

Cover image for Add Logging to AWS Lambda Without Redeploying Using a Simple Extension
Marko - ServerlessLife.com
Marko - ServerlessLife.com

Posted on • Originally published at serverlesslife.com

Add Logging to AWS Lambda Without Redeploying Using a Simple Extension

A reusable extension for Node.js Lambda that logs requests and responses without code changes or redeployment. Learn how to use it and how I built it.

The Challenge of Debugging AWS Lambda in Production

Debugging Lambda functions in production can be challenging. Without sufficient logging, it’s often difficult to diagnose issues in the system. You could use some observability tools like Lumigo. You could also use Lambda Live Debugger with Observability mode. In most cases, you are mostly left to the mercy of the logs you have. However, excessive logging in high-traffic serverless applications can lead to high CloudWatch costs.

The ideal solution is temporarily enabling logging without redeploying your Lambda function. But what if you didn’t build logging in a way that would support that? Is there a way to introduce this additional logging?

Fortunately, there is. Using this Lambda extension, you can add it to any Lambda function, even in production environments, with minimal impact on your system. It supports Lambda based on Nodej.js.

Debug smarter, not harder! 🔧 A Lambda extension to log requests and responses without redeployment 💪

The extension was originally developed as part of Lambda Live Debugger and a ServerlessSpy tool. Lambda Live Debugger is a tool that enables remote debugging of Lambda functions. It also speeds up development because you can avoid constant and timely redeploys. ServerlessSpy is a CDK-based library for writing elegant integration tests on AWS serverless architecture. It has an additional web console to monitor events in real-time.

...continue reading

Top comments (0)