Skip to content

Upgrade: [dependabot] - bump @aws-lambda-powertools/logger from 2.15.0 to 2.16.0 #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 10, 2025

Bumps @aws-lambda-powertools/logger from 2.15.0 to 2.16.0.

Release notes

Sourced from @​aws-lambda-powertools/logger's releases.

v2.16.0

Summary

We are excited to announce a new feature in Logger: Logger buffering. This new feature allows you to buffer logs for a specific invocation, and flush them automatically on error or manually as needed.

We also fixed a bug in the Batch Processing utility that prevented SQS FIFO messages from the same group to be processed correctly during retries

Finally, we now publish our Lambda layers to three new regions Mexico (mx-central-1), Thailand (ap-southeast-7), and Malaysia (ap-southeast-5).

⭐️ Thanks to @​VatsalGoel3 and @​ConnorKirk for their significant contributions to this release!

New Log Buffering feature

Docs

You can now enable log buffering by passing logBufferOptions when initializing a new Logger instance. This feature allows you to:

  • Buffer logs at the WARN, INFO, DEBUG, and TRACE levels
  • Automatically flush logs on error or manually as needed
  • Reduce CloudWatch costs by decreasing the number of emitted log messages

carbon-8

Configuration options

Option Description Default
maxBytes Maximum size of the buffer in bytes 20480
minLevel Minimum log level to buffer (more verbose levels are also buffered) DEBUG
flushOnErrorLog Whether to flush buffer when an error is logged true
enabled Whether log buffering is enabled N/A

When log buffering is enabled, you can now pass a new opt-in flushBufferOnUncaughtError flag to the injectLambdaContext() class method decorator and Middy.js middleware. When enabled, 1/ we'll intercept any error thrown, 2/ flush the buffer, and 3/ re-throw your original error. This enables you to have detailed logs from your application when you need them the most.

carbon-7

For detailed explanations with diagrams, please refer to our comprehensive documentation.

Buffering FAQs

Q: Does the buffer persist across Lambda invocations? A: No. Each Lambda invocation has its own buffer. The buffer initializes when the Lambda function is invoked and clears after function completion or manual flushing.

Q: Are my logs buffered during cold starts? A: No. We never buffer logs during cold starts to ensure all logs from this phase are immediately available for debugging.

Q: How can I prevent log buffering from consuming excessive memory? A: You can limit the size of the buffer by setting the maxBytes option in the logBufferOptions constructor parameter. This will ensure that the buffer does not grow indefinitely and consume excessive memory.

Q: What happens if the log buffer reaches its maximum size?

... (truncated)

Changelog

Sourced from @​aws-lambda-powertools/logger's changelog.

2.16.0 (2025-03-07)

Bug Fixes

Features

  • logger: Enable log buffering feature (#3641) (8203016)
  • logger: flush buffer on uncaught error decorator (#3676) (28db2e3)
  • logger: Flush buffer on uncaught error in Middy middleware (#3690) (23eebe4)
  • logger: refresh sample rate calculation before each invocation (#3672) (8c8d6b2)
  • validation: add @​validator decorator for JSON Schema validation (#3679) (ae6b7cf)
  • validation: Add Middy.js middleware for JSON Schema validation (#3694) (443202b)
  • validation: implement validate function (#3662) (f55127b)
Commits
  • 540a14b chore(ci): bump version to 2.16.0 (#3702)
  • 1ca4b26 refactor(logger): align implementation to spec + docs (#3701)
  • 1a48d2c chore(deps): bump jinja2 from 3.1.5 to 3.1.6 in /docs (#3698)
  • 443202b feat(validation): Add Middy.js middleware for JSON Schema validation (#3694)
  • 34d917e chore(deps): bump @​types/node from 22.13.8 to 22.13.9 (#3695)
  • 23eebe4 feat(logger): Flush buffer on uncaught error in Middy middleware (#3690)
  • 58f376e chore(deps): bump the aws-cdk group across 1 directory with 2 updates (#3687)
  • 9839e13 chore(deps): bump squidfunk/mkdocs-material from 2615302 to 047452c in /d...
  • 0693f71 chore(deps): bump mkdocs-material from 9.6.5 to 9.6.7 in /docs (#3686)
  • ae6b7cf feat(validation): add @​validator decorator for JSON Schema validation (#3679)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Mar 10, 2025
Copy link

@eps-autoapprove-dependabot eps-autoapprove-dependabot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this pull request because it includes a patch or minor update

@eps-autoapprove-dependabot eps-autoapprove-dependabot bot enabled auto-merge (squash) March 10, 2025 02:45
Bumps [@aws-lambda-powertools/logger](https://github.com/aws-powertools/powertools-lambda-typescript) from 2.15.0 to 2.16.0.
- [Release notes](https://github.com/aws-powertools/powertools-lambda-typescript/releases)
- [Changelog](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/CHANGELOG.md)
- [Commits](aws-powertools/powertools-lambda-typescript@v2.15.0...v2.16.0)

---
updated-dependencies:
- dependency-name: "@aws-lambda-powertools/logger"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/aws-lambda-powertools/logger-2.16.0 branch from b411a36 to 51b840c Compare March 10, 2025 02:49
Copy link

@eps-autoapprove-dependabot eps-autoapprove-dependabot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this pull request because it includes a patch or minor update

@eps-autoapprove-dependabot eps-autoapprove-dependabot bot merged commit 9b0cb09 into main Mar 10, 2025
5 checks passed
@eps-autoapprove-dependabot eps-autoapprove-dependabot bot deleted the dependabot/npm_and_yarn/aws-lambda-powertools/logger-2.16.0 branch March 10, 2025 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants