Class SerilogHostBuilderExtensions
Inheritance
System.Object
SerilogHostBuilderExtensions
Namespace: Steeltoe.Extensions.Logging.DynamicSerilog
Assembly: Steeltoe.Extensions.Logging.DynamicSerilogBase.dll
Syntax
public static class SerilogHostBuilderExtensions : object
Methods
| Edit this page View SourceAddDynamicSerilog(IHostBuilder, Action<HostBuilderContext, LoggerConfiguration>, Boolean, Boolean)
Configure Serilog as the IDynamicLoggerProvider to enable dynamically controlling log levels via management endpoints
Declaration
public static IHostBuilder AddDynamicSerilog(this IHostBuilder hostBuilder, Action<HostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveStaticLogger = false, bool preserveDefaultConsole = false)
Parameters
Type | Name | Description |
---|---|---|
IHostBuilder | hostBuilder | The |
Action<HostBuilderContext, LoggerConfiguration> | configureLogger | The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a |
System.Boolean | preserveStaticLogger | Indicates whether to preserve the value of |
System.Boolean | preserveDefaultConsole | When true, do not remove Microsoft's ConsoleLoggerProvider |
Returns
Type | Description |
---|---|
IHostBuilder | The |
UseSerilogDynamicConsole(IHostBuilder, Action<HostBuilderContext, LoggerConfiguration>, Boolean)
Sets Steeltoe IDynamicLoggerProvider Serilog implementation as a LoggerProvider which supports dynamically controlling the minimum log level via management endpoints
Declaration
public static IHostBuilder UseSerilogDynamicConsole(this IHostBuilder hostBuilder, Action<HostBuilderContext, LoggerConfiguration> configureLogger = null, bool preserveStaticLogger = false)
Parameters
Type | Name | Description |
---|---|---|
IHostBuilder | hostBuilder | The |
Action<HostBuilderContext, LoggerConfiguration> | configureLogger | The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a |
System.Boolean | preserveStaticLogger | Indicates whether to preserve the value of |
Returns
Type | Description |
---|---|
IHostBuilder | The |