I am trying to use NLog on my project and following these steps I wonder how I could define the NLog lines in my Program.cs because there are no Main() and CreateHostBuilder() for Blazor server side.
Hope anyone can point me to right direction.
Found it! It is
builder.Host.UseNLog();
Edited to add more samples:
builder.Logging.ClearProviders();
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Logging.AddNLog(new NLogProviderOptions {
CaptureMessageTemplates = true,
CaptureMessageProperties = true
});
builder.Host.UseNLog();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With