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

Serilog dupe stackframe fix #1076

Merged
merged 7 commits into from
May 4, 2022
Merged

Serilog dupe stackframe fix #1076

merged 7 commits into from
May 4, 2022

Conversation

jaffinito
Copy link
Member

@jaffinito jaffinito commented Apr 28, 2022

Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.

Description

Updates serilog wrapper to check for duplicate log entries by looking at the stackframes and checking for additional "Dispatch" methods.

There are two different versions of the stack trace, one that places the initial Dispatch method at 7 and one that places it at 8. The logic in the wrapper handles this.

Tests all pass and performance is acceptable (let me know if you want to go over it)

Closes #1070

Author Checklist

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)
  • Review Changelog

@jaffinito jaffinito added the bug Something isn't working label Apr 28, 2022
@jaffinito jaffinito added this to the Logging Initiative - GA milestone Apr 28, 2022
Copy link
Contributor

@JcolemanNR JcolemanNR left a comment

Choose a reason for hiding this comment

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

I think it would be vital to cover both of these stack depth use cases in integration tests so we don't introduce a regression or new bug if we refactor the current approach.

Copy link
Contributor

@JcolemanNR JcolemanNR left a comment

Choose a reason for hiding this comment

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

Thank you for adding comments! There are a few minor typos in them but I can live with that.

This needs integration test coverage still.

@jaffinito jaffinito requested a review from JcolemanNR May 2, 2022 22:53
Copy link
Contributor

@vuqtran88 vuqtran88 left a comment

Choose a reason for hiding this comment

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

We did a code walk through and addressed all of the concerned. This is good to go.

Copy link
Contributor

@JcolemanNR JcolemanNR left a comment

Choose a reason for hiding this comment

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

Great fix! Reviewed as a team and I approve.

@jaffinito jaffinito merged commit d594aa8 into main May 4, 2022
@jaffinito jaffinito deleted the serilog-dupe-stackframe-fix branch May 4, 2022 19:14
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.

Getting duplicate logs using log forwarding and Serilog
4 participants