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

Convert all logging to Serilog - #371

Merged
David Bennett (dkbennett) merged 1 commit into
mainfrom
user/dkbennett/logging
Apr 3, 2024
Merged

Convert all logging to Serilog#371
David Bennett (dkbennett) merged 1 commit into
mainfrom
user/dkbennett/logging

Conversation

@dkbennett

@dkbennett David Bennett (dkbennett) commented Mar 27, 2024

Copy link
Copy Markdown
Member

Summary of the pull request

Log conversion from serilog, very similar changes as: microsoft/DevHomeAzureExtension#143

References and relevant issues

Detailed description of the pull request / Additional comments

  • DevHome.Logging removed.
  • Serilog and related nuget packages added.
  • appsettings.json added to the project with log settings.
  • All static logging converted over to Serilog
  • Some log levels were changed for spammier components.
  • New logging added in places using lazy initialization.
  • TestContext sink added in place of TestListener, which writes Serilog events to the TestContext.
  • Updated all test setups to automatically log and output log messages to TestContext. This means any logs generated during test runs by components will be captured in both a temporary log and in the test output for easy analysis.
  • Updated testconsole with logging setup so ad hoc testing with it is already configured for logging.

Log formatting changes:

  • Log format was changed to be more compact, easier to parse and be human-readable.
  • Log format is similar to Serilog's default modified to be close to the previous log format.
  • Single log instead of multiple logs.
    Log has a daily interval where it will be a new file, rolling over 30 days.

Validation steps performed

  • Ran all tests and ensured they are producing logs and TestContext messages as well as passing.
  • Scenario tested widgets and verified logging.
  • Cloned a github repository by url

PR checklist

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

Comment thread src/GitHubExtension/Widgets/GitHubUserWidget.cs
"MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy",
"Microsoft.Windows.DevHome_8wekyb3d8bbwe",
"Microsoft.Windows.DevHomeGitHubExtension_8wekyb3d8bbwe",
"Microsoft.Windows.DevHomeGitHubExtension.Dev_8wekyb3d8bbwe",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this not be included, or should we include canary as well?

@dkbennett David Bennett (dkbennett) Mar 29, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should include all of the devhome and extension package name variants so the logging of packages present is complete.

@vineeththomasalex Vineeth Thomas Alex (vineeththomasalex) added the Needs-Second Pull request that needs another approval label Apr 3, 2024

@krschau Kristen Schau (krschau) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure if you wanted to include the other flavor/extensions from my other comment, but can be done after.

@krschau Kristen Schau (krschau) removed the Needs-Second Pull request that needs another approval label Apr 3, 2024
@krschau Kristen Schau (krschau) added this to the DHGE v0.13 milestone Apr 3, 2024
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.

3 participants