A custom Pino destination for AWS Lambda that reformats logs to match CloudWatch format, preserving @requestid, @timestamp, and @message properties for use with CloudWatch Insights, Datadog, and Splunk. Version 4.4.1, stable, semver releases. It automatically tracks request IDs, correlation IDs, and X-Ray tracing from upstream services. Ships TypeScript types.
npm install pino-lambdaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup: create destination, attach to pino, track request context at handler start, then log.
Install pino@>=6.0.0: npm install pino@^6.0.0
Always call withRequest(event, context) at the start of the handler function.
Do not pass any argument to pinoLambdaDestination(). To customize output, use pino's own options or transports.
Use pinoLambdaDestination() only in Lambda; for non-Lambda environments, use pino's default destination.
Use withRequest(event, context) directly inside handler body.
Install pino-lambda: npm install pino-lambda. If using TypeScript, ensure types are included (they ship with the package).
Use import { pinoLambdaDestination } from 'pino-lambda' (curly braces).Install pino>=6.0.0: npm install pino@^6.0.0
Ensure withRequest(event, context) is called before any logger.info() calls.