Table of Contents

Class SerilogBuilderExtensions

Namespace
Steeltoe.Extensions.Logging.SerilogDynamicLogger
Assembly
Steeltoe.Extensions.Logging.SerilogDynamicLogger.dll
public static class SerilogBuilderExtensions
Inheritance
SerilogBuilderExtensions
Inherited Members

Methods

AddSerilogDynamicConsole(ILoggingBuilder, LoggerConfiguration, bool)

Add Serilog with Console sink, wrapped in a IDynamicLoggerProvider that supports dynamically controlling the minimum log level via management endpoints

public static ILoggingBuilder AddSerilogDynamicConsole(this ILoggingBuilder builder, LoggerConfiguration serilogConfiguration, bool preserveDefaultConsole = false)

Parameters

builder ILoggingBuilder

The ILoggingBuilder for configuring the LoggerFactory

serilogConfiguration LoggerConfiguration

The LoggerConfiguration

preserveDefaultConsole bool

When true, do not remove Microsoft's ConsoleLoggerProvider

Returns

ILoggingBuilder

The configured ILoggingBuilder

AddSerilogDynamicConsole(ILoggingBuilder, bool)

Add Serilog with Console sink, wrapped in a IDynamicLoggerProvider that supports dynamically controlling the minimum log level via management endpoints

public static ILoggingBuilder AddSerilogDynamicConsole(this ILoggingBuilder builder, bool preserveDefaultConsole = false)

Parameters

builder ILoggingBuilder

The ILoggingBuilder for configuring the LoggerFactory

preserveDefaultConsole bool

When true, do not remove Microsoft's ConsoleLoggerProvider

Returns

ILoggingBuilder

The configured ILoggingBuilder

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

public static IWebHostBuilder UseSerilogDynamicConsole(this IWebHostBuilder builder, Action<WebHostBuilderContext, LoggerConfiguration> configureLogger, bool preserveStaticLogger = false)

Parameters

builder IWebHostBuilder

The IWebHostBuilder for configuring the WebHostBuilder

configureLogger Action<WebHostBuilderContext, LoggerConfiguration>

The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger

preserveStaticLogger bool

Indicates whether to preserve the value of Logger.

Returns

IWebHostBuilder

The IWebHostBuilder

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

public static IHostBuilder UseSerilogDynamicConsole(this IHostBuilder builder, Action<HostBuilderContext, LoggerConfiguration> configureLogger, bool preserveStaticLogger = false)

Parameters

builder IHostBuilder

The IWebHostBuilder for configuring the WebHostBuilder

configureLogger Action<HostBuilderContext, LoggerConfiguration>

The delegate for configuring the DynamicLoggerConfiguration that will be used to construct a Logger

preserveStaticLogger bool

Not Supported!

Returns

IHostBuilder

The IWebHostBuilder