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 exception logging #379

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

dkbennett
Copy link
Member

Summary of the pull request

This fixes the ordering of exception logging such that exceptions will be properly logged.

References and relevant issues

Closes #378

Detailed description of the pull request / Additional comments

Serilog has multiple valid logging signatures, but the only one that logs exceptions is if the exception is the first argument. Exceptions can be placed validly as 2nd, 3rd, etc. arguments after a string but those are assumed to be part of the message template and otherwise ignored. This resulted in valid log messages but exceptions that were intended to be logged were not being logged.

  • Fixed all Fatal, Error, Warning, Debug, and Information logging that included an exception at the end of the message and moved it to the front of the message so it would be logged instead of swallowed.

Validation steps performed

  • Build validation

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@EricJohnson327 EricJohnson327 merged commit b7a4368 into main Apr 11, 2024
4 checks passed
@EricJohnson327 EricJohnson327 deleted the user/dkbennett/fixexceptionlogging branch April 11, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exceptions are not being logged
3 participants