Class SerilogHostBuilderExtensions
- Namespace
- Steeltoe.Extensions.Logging.DynamicSerilog
- Assembly
- Steeltoe.Extensions.Logging.DynamicSerilogBase.dll
public static class SerilogHostBuilderExtensions
- Inheritance
-
SerilogHostBuilderExtensions
- Inherited Members
Methods
AddDynamicSerilog(IHostBuilder, Action<HostBuilderContext, LoggerConfiguration>, bool, bool)
Configure Serilog as the IDynamicLoggerProvider to enable dynamically controlling log levels via management endpoints
public static IHostBuilder AddDynamicSerilog(this IHostBuilder hostBuilder, Action<HostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveStaticLogger = false, bool preserveDefaultConsole = false)
Parameters
hostBuilder
IHostBuilderThe IHostBuilder to configure
configureLogger
Action<HostBuilderContext, LoggerConfiguration>The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger
preserveStaticLogger
boolIndicates whether to preserve the value of Logger.
preserveDefaultConsole
boolWhen true, do not remove Microsoft's ConsoleLoggerProvider
Returns
UseSerilogDynamicConsole(IHostBuilder, Action<HostBuilderContext, 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 IHostBuilder UseSerilogDynamicConsole(this IHostBuilder hostBuilder, Action<HostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveStaticLogger = false)
Parameters
hostBuilder
IHostBuilderThe IHostBuilder to configure
configureLogger
Action<HostBuilderContext, LoggerConfiguration>The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger
preserveStaticLogger
boolIndicates whether to preserve the value of Logger.