Posted On: Jul 11, 2024

Amazon Lambda announces advanced logging controls that enable you to natively capture logs in JSON structured format, adjust log levels, and select the Amazon CloudWatch log group for your Lambda functions.

You can now capture your Lambda logs in JSON structured format without having to bring your own logging libraries. JSON format allows logs to be structured as a series of key-value pairs, enabling you to quickly search, filter, and analyze your function logs. You can also control the log level (e.g., ERROR, DEBUG, INFO, etc.) of your Lambda logs without making any code changes. This enables you to choose the desired logging granularity level for your function, eliminating the need to sift through large volumes of logs while debugging and troubleshooting critical errors. Lastly, you can choose the CloudWatch log group to which Lambda sends your logs. This allows you to easily aggregate logs from multiple functions within an application in one place, and apply security, governance, and retention policies at the application level, rather than applying them individually to every function.

To get started, you can specify advanced logging controls for your Lambda functions using Lambda API, Lambda console, Amazon CLI, Amazon Serverless Application Model (SAM), and Amazon CloudFormation. To learn more, visit the Lambda Developer Guide

Lambda advanced logging controls are now available in Amazon Web Services China (Beijing) Region, operated by Sinnet and Amazon Web Services China (Ningxia) Region, operated by NWCD. For more information on availability, see the Amazon Web Services Region table.