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

Replace all logging with Serilog - #143

Merged
David Bennett (dkbennett) merged 5 commits into
mainfrom
user/dkbennett/serilog
Mar 27, 2024
Merged

Replace all logging with Serilog#143
David Bennett (dkbennett) merged 5 commits into
mainfrom
user/dkbennett/serilog

Conversation

@dkbennett

Copy link
Copy Markdown
Member

Summary of the pull request

Removes DevHome.Logging and replaces it with Serilog with appropriate sinks for Console and File logging.

Format of the logs has changed, as well as where they are located.

Single log in the TempState folder for the application instead of multiple logs.

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 repository by url

PR checklist

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

@dhoehna Darren Hoehna (dhoehna) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good from Repo perspective.

@dkbennett
David Bennett (dkbennett) marked this pull request as ready for review March 26, 2024 23:01
@dkbennett David Bennett (dkbennett) added the Needs-Second Pull request that needs another approval label Mar 27, 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.

4 participants