8000 Fix exception logging by dkbennett · Pull Request #379 · microsoft/devhomegithubextension · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix exception logging#379

Merged
EricJohnson327 merged 1 commit intomainfrom
user/dkbennett/fixexceptionlogging
Apr 11, 2024
Merged

Fix exception logging#379
EricJohnson327 merged 1 commit intomainfrom
user/dkbennett/fixexceptionlogging

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
@EricJohnson327 EricJohnson327 deleted the user/dkbennett/fixexceptionlogging branch April 11, 2024 01:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exceptions are not being logged

3 participants

0