Skip to content
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

fix: append structured logs when injecting lambda context #86

Merged

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented Jul 5, 2020

Issue #, if available: #85

Description of changes:

Bugfix for #85

This ensures that when structure_logs is used before inject_lambda_context it'll have both keys. This can happen in two situations:

  1. When a customer uses a custom middleware and reuses inject_lambda_context as described in Logger: inject_lambda_context overrides keys appended before in custom middleware #85
  2. Use structure_logs in the global scope

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@heitorlessa heitorlessa added the bug Something isn't working label Jul 5, 2020
@heitorlessa heitorlessa requested a review from to-mc July 5, 2020 18:58
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2020

Codecov Report

Merging #86 into develop will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop       #86   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          474       474           
  Branches        42        42           
=========================================
  Hits           474       474           
Impacted Files Coverage Δ
aws_lambda_powertools/logging/logger.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a63141...6c72421. Read the comment docs.

Signed-off-by: heitorlessa <[email protected]>
Signed-off-by: heitorlessa <[email protected]>
@heitorlessa heitorlessa merged commit 0670e5e into aws-powertools:develop Jul 5, 2020
@heitorlessa heitorlessa deleted the fix/logger-append-on-inject branch July 5, 2020 19:26
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Oct 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

This is now released under 1.30.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants