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

improv: keeps Lambda root logger handler, and add log filter instead to prevent child log records duplication #198

Merged
merged 3 commits into from
Oct 25, 2020

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented Oct 23, 2020

Issue #, if available: #194

Description of changes:

This PR adds a log filter in the root logger to reject any log record coming from our Logger - This will prevent child logger to propagate log records to their parents as well as root loggers leading to duplicated log entries.

This unblocks issue described in 194 when customers assume root logger to be configured as per Lambda docs.

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 bug Something isn't working area/logger labels Oct 23, 2020
@heitorlessa heitorlessa marked this pull request as draft October 23, 2020 21:11
@heitorlessa heitorlessa marked this pull request as ready for review October 24, 2020 17:22
@codecov-io
Copy link

codecov-io commented Oct 24, 2020

Codecov Report

Merging #198 into develop will decrease coverage by 0.08%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #198      +/-   ##
===========================================
- Coverage    99.87%   99.79%   -0.09%     
===========================================
  Files           65       66       +1     
  Lines         2451     2460       +9     
  Branches       108      110       +2     
===========================================
+ Hits          2448     2455       +7     
- Misses           3        4       +1     
- Partials         0        1       +1     
Impacted Files Coverage Δ
aws_lambda_powertools/logging/filters.py 75.00% <75.00%> (ø)
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 e545820...61cddb0. Read the comment docs.

@heitorlessa heitorlessa merged commit 828fec4 into develop Oct 25, 2020
@heitorlessa heitorlessa deleted the improv/suppress-logger-propagation branch October 25, 2020 17:01
@heitorlessa heitorlessa changed the title improv: add log filter in root handler to prevent child log records duplication improv: keeps Lambda root logger handler; add log filter instead to prevent child log records duplication Oct 26, 2020
@heitorlessa heitorlessa changed the title improv: keeps Lambda root logger handler; add log filter instead to prevent child log records duplication improv: keeps Lambda root logger handler, and add log filter instead to prevent child log records duplication Oct 26, 2020
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.

2 participants