Class SerilogWebHostBuilderExtensions
Inheritance
Namespace: Steeltoe.Extensions.Logging.DynamicSerilog
Assembly: Steeltoe.Extensions.Logging.DynamicSerilogCore.dll
Syntax
public static class SerilogWebHostBuilderExtensions : object
Methods
| Edit this page View SourceAddDynamicSerilog(IWebHostBuilder, Action<WebHostBuilderContext, LoggerConfiguration>, Boolean)
Configure Serilog as the
Declaration
public static IWebHostBuilder AddDynamicSerilog(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveDefaultConsole = false)
Parameters
Type | Name | Description |
---|---|---|
IWebHostBuilder | hostBuilder | The |
Action<WebHostBuilderContext, LoggerConfiguration> | configureLogger | The delegate for configuring the |
System.Boolean | preserveDefaultConsole | When true, do not remove Microsoft's ConsoleLoggerProvider |
Returns
Type | Description |
---|---|
IWebHostBuilder | The |
AddDynamicSerilog(IWebHostBuilder, Action<WebHostBuilderContext, LoggerConfiguration>, Boolean, Boolean)
Configure Serilog as the
Declaration
public static IWebHostBuilder AddDynamicSerilog(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger, bool preserveStaticLogger, bool preserveDefaultConsole = false)
Parameters
Type | Name | Description |
---|---|---|
IWebHostBuilder | hostBuilder | The |
Action<WebHostBuilderContext, LoggerConfiguration> | configureLogger | The delegate for configuring the |
System.Boolean | preserveStaticLogger | Not Supported! |
System.Boolean | preserveDefaultConsole | When true, do not remove Microsoft's ConsoleLoggerProvider |
Returns
Type | Description |
---|---|
IWebHostBuilder | The |
UseSerilogDynamicConsole(IWebHostBuilder, Action<WebHostBuilderContext, LoggerConfiguration>, Boolean)
Sets Steeltoe
Declaration
public static IWebHostBuilder UseSerilogDynamicConsole(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveStaticLogger = false)
Parameters
Type | Name | Description |
---|---|---|
IWebHostBuilder | hostBuilder | The |
Action<WebHostBuilderContext, LoggerConfiguration> | configureLogger | The delegate for configuring the |
System.Boolean | preserveStaticLogger | Indicates whether to preserve the value of |
Returns
Type | Description |
---|---|
IWebHostBuilder | The |