Lambda: Application Objects

How to log objects and classes from the Lambda application code

Dashbird is a monitoring platform for monitoring modern cloud infrastructure by providing alerts, insights and data visualisation.

Start a Free Trial Learn more

Overview

Logging application objects from a Lambda function code can be useful in a variety of cases:

  • Being able to identify every contextual information involved in a possible application failure
  • Check data points that might have been exposed in a security breach
  • What was the state of a given object before and after a certain action was executed

How-to

As discussed in the AWS Lambda Programming Model1 page, AWS Lambda logs are stored in CloudWatch Logs. It can automatically detect a JSON string and format it for easy visualization in the AWS Console.

External debugging platforms - such as Dashbird - will offer enhanced visualization for JSON strings, with support to expand and collapse object nodes.

For that reason, it is recommended to create a JSON-serializable version of all relevant objects and classes in the code. This way they can be easily logged and inspected in any debugging tool. Having a method for JSON-serialization (e.g. object.to_json()) would be ideal to standardize the implementation across the application functions.


Footnotes


  1. AWS Lambda Programming Model ↩︎

Operate Cloud Applications at Highest Quality

Save time spent on debugging applications.

Increase development velocity and quality.

Get actionable insights to your infrastructure.

Finish setup in 2 minutes!