Posted On: Nov 12, 2020

You can now send logs from AWS Lambda functions directly to a destination of your choice by using AWS Lambda Extensions. AWS Lambda Extensions are a new way for monitoring, observability, security, and governance tools to integrate with Lambda, and today, you can use extensions that send logs to the following providers: Datadog, New Relic, Sumo Logic, Honeycomb, Lumigo, and Coralogix.

To help you troubleshoot failures in Lambda functions, the Lambda service automatically captures logs and streams them to Amazon CloudWatch. This stream contains the logs which are generated from within your function code, and also those generated by the Lambda service as part of the invoke.

Extensions for tools like logging agents can now use the new AWS Lambda Runtime Logs API to subscribe to log streams directly from within the Lambda execution environment. After receiving the subscription request, the Lambda service streams logs to the extension, and the extension can then process, filter, and send them to any preferred destination. This makes it even easier for you to use your preferred extensions for diagnostics.

The Runtime Logs API is now available (in preview) in all commercial regions where AWS Lambda is available, except for regions in China. For more information, see the AWS Region table.  

You can deploy extensions that use the Runtime Logs API, by using Layers through the Lambda Console or the AWS CLI. You can also use infrastructure as code tools such as CloudFormation, the AWS Serverless Application Model, and Terraform. To get started with extensions from AWS APN Partners, install their extensions by following the links provided in the launch blog post.

You can build your own extensions as well. To learn how to build extensions which use the Runtime Logs API, visit the AWS Lambda Developer Guide.