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 logging solution to Serilog #2474

Merged
merged 7 commits into from
Mar 27, 2024
Merged

Convert logging solution to Serilog #2474

merged 7 commits into from
Mar 27, 2024

Conversation

dkbennett
Copy link
Member

@dkbennett dkbennett commented Mar 27, 2024

Summary of the pull request

Converts all logging infrastructure in Dev Home over to using Serilog. This conversion is a 1:1 translation for the most part, removing the old in-house logging solution and replacing it with Serilog. Further optimizations and improvements can be made now that the logging is moved to a more consistent paradigm with Serilog. This also works much better with Dependency Injection, which is one of the foreseen next steps following this conversion.

References and relevant issues

Detailed description of the pull request / Additional comments

  • Entirely removed old logging solution and all of its references.
  • Added Serilog and Serilog ILogger into the services.
  • Converted previous static logging over to Serilog static logging.
  • Updated log locations and format.
  • Added appsettings.json for DevHome for the HyperV extension and the Core Widgets extension.
  • Updated appsettings for DevHome with Serilog configuration data.
  • Log files are more consolidated now, with DevHome having a single log, the Core Widgets extension having a single separate log, and the HyperV extension having a single separate log. All log files are now under the temp folder under "Logs" with a sub folder for each of these three main programs.
  • Did not adjust the verbosity of logs, leaving filtering to tooling and verbosity adjustments to be made in a subsequent PR. This is relevant since the logs are now combined instead of separate. Chattier components may make the logs a little more difficult to read but can be alleviated by log parsing tooling.

Validation steps performed

  • Built all of the solutions, debug and release in VS and using build scripts.
  • Cloned repository by URI
  • Added and configured widgets, core widgets, and hyper v.
  • Verified log file locations were correct and output was in the expected format.

PR checklist

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

@dkbennett
Copy link
Member Author

/azp run

Copy link

Pull request contains merge conflicts.

Copy link
Contributor

@dhoehna dhoehna left a comment

Choose a reason for hiding this comment

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

Looks good in my area.

@dkbennett dkbennett merged commit 2b92f2b into main Mar 27, 2024
4 checks passed
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.

4 participants