Skip to content

Fix benchmarks actually measuring NoopLoggerProvider instead of configured loggers - #5

Draft
Zeroshi with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-bug-with-nlog-integration
Draft

Fix benchmarks actually measuring NoopLoggerProvider instead of configured loggers#5
Zeroshi with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-bug-with-nlog-integration

Conversation

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown

BuildLogger unconditionally called ClearProviders() then injected NoopLoggerProvider, wiping out every registered logging provider. Every benchmark — NLog, Log4Net, Serilog — was measuring identical no-op overhead, not the actual logger pipelines.

Changes

  • BuildLogger: Remove the ClearProviders() + NoopLoggerProvider override; let each benchmark use its own registered provider.
  • MS Logger baseline: Apply NoopLoggerProvider explicitly in the MS logger setup only — it's the intended noop baseline.
  • NLog: Replace LoadConfigurationFromFile("nlog.config") with an empty LoggingConfiguration — NLog pipeline active, no file I/O:
    s.AddLogging(b => b.AddNLog(new NLog.Config.LoggingConfiguration()));
  • Log4Net: Replace XmlConfigurator file-based config with a programmatic MemoryAppender — Log4Net pipeline active, no file I/O.
  • Cleanup: Remove now-unused using log4net.Config and NLogManager alias.

Copilot AI linked an issue Jul 12, 2026 that may be closed by this pull request
- Remove ClearProviders()/NoopLoggerProvider override from BuildLogger so
  each benchmark actually exercises its configured logging provider
- Use NoopLoggerProvider only for the MS logger baseline benchmarks
- Configure NLog with an empty LoggingConfiguration (no targets = no file
  I/O, but NLog pipeline is active)
- Configure Log4Net with a MemoryAppender (no file I/O, Log4Net pipeline active)
- Remove now-unused `using log4net.Config` and `NLogManager` alias
Copilot AI changed the title [WIP] Fix BuildLogger to use NLogLoggingProvider instead of NoopLoggerProvider Fix benchmarks actually measuring NoopLoggerProvider instead of configured loggers Jul 12, 2026
Copilot AI requested a review from Zeroshi July 12, 2026 02:48
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.

BuildLogger always uses NoopLoggerProvider

2 participants