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

Convert all logging to Serilog #371

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Convert all logging to Serilog #371

merged 1 commit into from
Apr 3, 2024

Conversation

dkbennett
Copy link
Member

@dkbennett dkbennett commented Mar 27, 2024

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

@dkbennett dkbennett marked this pull request as ready for review March 28, 2024 18:32
@@ -140,6 +152,7 @@ private static void LogPackageInformation()
"MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy",
"Microsoft.Windows.DevHome_8wekyb3d8bbwe",
"Microsoft.Windows.DevHomeGitHubExtension_8wekyb3d8bbwe",
"Microsoft.Windows.DevHomeGitHubExtension.Dev_8wekyb3d8bbwe",
Copy link
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?

Copy link
Member Author

@dkbennett dkbennett Mar 29, 2024

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 vineeththomasalex added the Needs-Second Pull request that needs another approval label Apr 3, 2024
Copy link
Collaborator

@krschau krschau left a comment

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.

@dkbennett dkbennett merged commit 06c9683 into main Apr 3, 2024
4 checks passed
@krschau krschau removed the Needs-Second Pull request that needs another approval label Apr 3, 2024
@krschau krschau added this to the DHGE v0.13 milestone Apr 3, 2024
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.

3 participants