Skip to content

Conversation

snakefoot
Copy link

@snakefoot snakefoot commented Oct 9, 2025

Instead of "Default" implicit meaning "Sync", then instead make "Async" explicit for NLog and Serilog.

Updated to NLog v6.0.5 that changes NullTarget to be non-allocating with FormatMessage = true, but still exercises the NLog-Logging-engine.

Changed from NLog.LogFactory.Shutdown() to Flush() for the "Async"-benchmarks, and removed Shutdown() from non-async-benchmarks that doesn't use background-threads.

@snakefoot snakefoot changed the title Benchmark changed to Async for NLog and Serilog Benchmark renamed Default to Async for NLog and Serilog Oct 9, 2025
@snakefoot snakefoot changed the title Benchmark renamed Default to Async for NLog and Serilog Benchmarks renamed Default to Async for NLog and Serilog Oct 9, 2025
nLogConfigDefault.AddRuleForAllLevels(target);
nLogConfig.AddTarget(target);
nLogConfig.AddRuleForAllLevels(target);
nLogConfig.LogFactory.Configuration = nLogConfig;
Copy link
Author

@snakefoot snakefoot Oct 9, 2025

Choose a reason for hiding this comment

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

Notice this is a bug-fix, where before NLog "Default" (Sync) was not assigned any configuration.

{
nLogMsExtLogger.LogInformation(MessageSample.Message, MessageSample.Arg1, MessageSample.Arg2,
MessageSample.Arg3);
nLogAsyncMsExtLogger.GeneratedLog(MessageSample.Arg1, MessageSample.Arg2, MessageSample.Arg3);
Copy link
Author

Choose a reason for hiding this comment

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

Fixed to use GeneratedLog since SourceGenerator-benchmark.

@snakefoot snakefoot changed the title Benchmarks renamed Default to Async for NLog and Serilog Renamed Benchmarks to explicit say Async for NLog and Serilog Oct 9, 2025
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.

1 participant