-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I am having a strange issue where LogEventLevel.Debug
logs (or those written directly via Log.Debug()
) do not show in the Debug console, unless .MinimumLevel.Debug()
is applied to the global logger, despite the fact that the extension's default restrictedToMinimumLevel
parameter is defaulted to LevelAlias.Minimum
so the sink itself should be actioning debug
level logs.
Configuring logger:
Logging.cs
[Conditional("DEBUG")]
public static void ConfigureDebugLogging()
{
Log.Logger = new LoggerConfiguration()
.WriteTo.Debug()
.CreateLogger();
}
App.xaml.cs
Logging.ConfigureDebugLogging();
Log.Debug("Logging has started");
Log.Information("Logging has started");
Confusingly, this starts to work if I apply a .MinimumLevel.Debug()
chain to the logger initialisation:
[Conditional("DEBUG")]
public static void ConfigureDebugLogging()
{
Log.Logger = new LoggerConfiguration()
.WriteTo.Debug()
.MinimumLevel.Debug()
.CreateLogger();
}
...but not if this is applied to the sink itself (which I would assume to be redundant as the sink defaults to this anyway):
[Conditional("DEBUG")]
public static void ConfigureDebugLogging()
{
Log.Logger = new LoggerConfiguration()
.WriteTo.Debug(restrictedToMinimumLevel: LogEventLevel.Debug)
.CreateLogger();
}
Running version 3.0.0
of this package inside a .NET 8.0 WPF Solution.
Metadata
Metadata
Assignees
Labels
No labels