Replace logging own implementation with withMicrosoft Extensions Logging#4806
Merged
arturcic merged 31 commits intoGitTools:next/v7from Feb 3, 2026
Merged
Conversation
746b685 to
ddc30d4
Compare
08e6a50 to
571466a
Compare
b7c2089 to
950d0d1
Compare
fde552d to
85790ef
Compare
Move IConsole interface and ConsoleAdapter implementation from GitVersion.Logging namespace to the GitVersion namespace under a new Console folder for better organization.
Add new logging enrichers and extensions for Serilog integration: - LoggingEnricher: controls log level and file output path dynamically - SensitiveDataEnricher: masks passwords in URLs using GeneratedRegex - LoggerExtensions: provides BeginTimedOperation and LogSeparator methods The SensitiveDataEnricher replaces the external Serilog.Enrichers.Sensitive package to avoid assembly loading issues in MSBuild task context.
Add TestLogger<T>, TestLoggerFactory, and FactoryLogger<T> to support capturing log messages in unit tests when using ILogger<T> instead of the legacy ILog interface.
Add Serilog packages to support the new logging system: - Serilog - Serilog.Extensions.Logging - Serilog.Sinks.Console - Serilog.Sinks.File - Serilog.Sinks.Map - Microsoft.Extensions.Logging.Abstractions Remove Serilog.Enrichers.Sensitive which caused MSBuild assembly loading issues.
Add AddGitVersionLogging extension method to configure Serilog with: - Console output (conditionally enabled) - File output (dynamically configured via LoggingEnricher) - SensitiveDataEnricher for URL password masking - LoggingEnricher for verbosity control Update GitVersionCommonModule to use the new logging system.
arturcic
added a commit
that referenced
this pull request
Feb 8, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Feb 8, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Feb 14, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Feb 16, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Feb 16, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Feb 16, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 1, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 1, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 2, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 2, 2026
…-logging-with-ms-extensions
arturcic
added a commit
that referenced
this pull request
Mar 2, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 2, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 2, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 2, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 3, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 3, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 3, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 4, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 5, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 6, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 7, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 10, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 12, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 12, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 12, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 12, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
that referenced
this pull request
Mar 12, 2026
…s-extensions Replace logging own implementation with withMicrosoft Extensions Logging
arturcic
added a commit
to arturcic/GitVersion
that referenced
this pull request
Mar 14, 2026
…g-with-ms-extensions Replace logging own implementation with withMicrosoft Extensions Logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major overhaul of the logging system, replacing the custom
ILogabstraction with the industry-standardMicrosoft.Extensions.Logging(M.E.L.) infrastructure, using Serilog as the underlying provider. It removes the legacy logging types, updates dependency injection and usage throughout the codebase, and ensures logging configuration is handled consistently at application startup. Several test and helper classes have also been updated or removed to align with the new logging approach.Logging System Replacement and Refactoring:
ILoglogging system and related types (ILog,ILogAppender,LogLevel, etc.) have been removed and replaced withMicrosoft.Extensions.Loggingand Serilog. Consumers now useILogger<T>and related abstractions. [1] [2] F61fee1bL18R18, [3]LoggingEnricher.Configuremethod, which sets up log file paths, verbosity, and console output based on command-line arguments. [1] [2] [3]GitVersionApp,GitVersionExecutor, and test fixtures have been updated to use dependency-injectedILogger<T>instances. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Dependency and Project File Updates:
Microsoft.Extensions.Logging,Microsoft.Extensions.Logging.Abstractions, and Serilog-related packages to the project dependencies, and updated using statements and project references accordingly. [1] F61fee1bL18R18, [2] [3]Test and Helper Cleanup:
TestLogAppender, and updated test setup to use the new logging system. [1] [2] [3] [4]Documentation:
BREAKING_CHANGES.mddetailing the migration steps and impact of the logging system replacement for custom integrations and extensions.Minor Test Adjustments:
These changes modernize the logging infrastructure, improve extensibility and maintainability, and bring the codebase in line with .NET ecosystem best practices.