Our AWS integration deploys a CloudFormation stack that forwards your CloudWatch log groups β Lambda's included β along with CloudWatch metrics and X-Ray traces. The setup below ships logs from individual functions without touching the rest of your account.
Logging in AWS Lambda running Node.js
Collect logs from your AWS Lambda running Node.js code.
1. Install
Node.js version 22.0 or higher is required.
The extension is built for the nodejs22.x and nodejs24.x runtimes. AWS deprecated Node.js 20 and older.
Already running on nodejs20.x? Update your function's runtime to nodejs22.x or newer, then republish the layer with the command below.
Take care to publish the layer in the region your Lambda function resides in. If that's not your default region, you can change it by adding --region <region-name> parameter to the command above.
Using a Windows machine?
To avoid compatibility issues caused by different line endings, build and upload the Lambda layer using WSL.
2. Add layer to your Lambda functions
In your AWS Console, add the logtail-lambda-extension layer to the Node.js Lambda functions you want to collect logs from.
This can be done in Lambda β Functions β your function β Layers section.
For details, check AWS docs.
3. Configure your source token
In your AWS Console, set up SOURCE_TOKEN and INGESTING_HOST environment variables for the AWS Lambda functions like this: