Class SerilogWebHostBuilderExtensions
- Namespace
- Steeltoe.Extensions.Logging.DynamicSerilog
- Assembly
- Steeltoe.Extensions.Logging.DynamicSerilogCore.dll
public static class SerilogWebHostBuilderExtensions
- Inheritance
-
SerilogWebHostBuilderExtensions
- Inherited Members
Methods
AddDynamicSerilog(IWebHostBuilder, Action<WebHostBuilderContext, LoggerConfiguration>, bool)
Configure Serilog as the IDynamicLoggerProvider to enable dynamically controlling log levels via management endpoints
public static IWebHostBuilder AddDynamicSerilog(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveDefaultConsole = false)
Parameters
hostBuilder
IWebHostBuilderThe IWebHostBuilder to configure
configureLogger
Action<WebHostBuilderContext, LoggerConfiguration>The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger
preserveDefaultConsole
boolWhen true, do not remove Microsoft's ConsoleLoggerProvider
Returns
AddDynamicSerilog(IWebHostBuilder, Action<WebHostBuilderContext, LoggerConfiguration>, bool, bool)
Configure Serilog as the IDynamicLoggerProvider to enable dynamically controlling log levels via management endpoints
[Obsolete("Use a different overload of AddDynamicSerilog")]
public static IWebHostBuilder AddDynamicSerilog(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger, bool preserveStaticLogger, bool preserveDefaultConsole = false)
Parameters
hostBuilder
IWebHostBuilderThe IWebHostBuilder to configure
configureLogger
Action<WebHostBuilderContext, LoggerConfiguration>The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger
preserveStaticLogger
boolNot Supported!
preserveDefaultConsole
boolWhen true, do not remove Microsoft's ConsoleLoggerProvider
Returns
UseSerilogDynamicConsole(IWebHostBuilder, Action<WebHostBuilderContext, LoggerConfiguration>, bool)
Sets Steeltoe IDynamicLoggerProvider Serilog implementation as a LoggerProvider which supports dynamically controlling the minimum log level via management endpoints
[Obsolete("Please use 'AddDynamicSerilog' instead")]
public static IWebHostBuilder UseSerilogDynamicConsole(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveStaticLogger = false)
Parameters
hostBuilder
IWebHostBuilderThe IWebHostBuilder to configure
configureLogger
Action<WebHostBuilderContext, LoggerConfiguration>The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger
preserveStaticLogger
boolIndicates whether to preserve the value of Logger.