public static class SerilogExtensionsInheritance System.Object 🡒 SerilogExtensions
SerilogExtensions.UseSerilog(this IHostApplicationBuilder, Action<IHostApplicationBuilder,IServiceProvider,LoggerConfiguration>, bool, bool) Method
Sets Serilog as the logging provider.
public static Microsoft.Extensions.Hosting.IHostApplicationBuilder UseSerilog(this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, System.Action<Microsoft.Extensions.Hosting.IHostApplicationBuilder,System.IServiceProvider,Serilog.LoggerConfiguration> configureLogger, bool preserveStaticLogger=false, bool writeToProviders=false);builder Microsoft.Extensions.Hosting.IHostApplicationBuilder
The Microsoft.Extensions.Hosting.IHostApplicationBuilder to configure.
configureLogger System.Action<Microsoft.Extensions.Hosting.IHostApplicationBuilder,System.IServiceProvider,Serilog.LoggerConfiguration>
The delegate for configuring the Serilog.LoggerConfiguration that will be used
to construct a Serilog.Core.Logger.
preserveStaticLogger System.Boolean
Indicates whether to preserve the value of Serilog.Log.Logger.
writeToProviders System.Boolean
By default, Serilog does not write events to Microsoft.Extensions.Logging.ILoggerProviders
registered through the Microsoft.Extensions.Logging API. Normally, equivalent Serilog sinks are used in place of providers.
Specify true to write events to all providers.
Microsoft.Extensions.Hosting.IHostApplicationBuilder
The host application builder.
This is (hopefully) a temporary replacement for Serilog.Extensions.Hosting.UseSerilog. It's necessary
to support working with the new Host.CreateApplicationBuilder() pattern being rolled out in .NET 7, which
does not currently support the IHostBuilder interface.