Table of Contents

Class DynamicLoggerProviderBase

Namespace
Steeltoe.Extensions.Logging
Assembly
Steeltoe.Extensions.Logging.Abstractions.dll
public class DynamicLoggerProviderBase : IDynamicLoggerProvider, ILoggerProvider, IDisposable
Inheritance
DynamicLoggerProviderBase
Implements
Derived
Inherited Members

Constructors

DynamicLoggerProviderBase(Func<ILoggerProvider>, InitialLevels, IEnumerable<IDynamicMessageProcessor>)

Initializes a new instance of the DynamicLoggerProviderBase class. Contains base functionality for DynamicLoggerProvider.

public DynamicLoggerProviderBase(Func<ILoggerProvider> getDelegateLogger, InitialLevels initialLevels, IEnumerable<IDynamicMessageProcessor> messageProcessors)

Parameters

getDelegateLogger Func<ILoggerProvider>

Function to a delegate Logger

initialLevels InitialLevels

Set the initialial filter levels

messageProcessors IEnumerable<IDynamicMessageProcessor>

Any IDynamicMessageProcessor Messageprocesors

Methods

CreateLogger(string)

Create or retrieve an instance of an ILogger

public ILogger CreateLogger(string categoryName)

Parameters

categoryName string

Class name that will be using the logger

Returns

ILogger

A logger with level filtering for a given class

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

GetLoggerConfigurations()

Get a list of logger configurations

public ICollection<ILoggerConfiguration> GetLoggerConfigurations()

Returns

ICollection<ILoggerConfiguration>

Namespaces and loggers with minimum log levels

SetLogLevel(string, LogLevel?)

Sets minimum log level for a given category and its decendants - resets to configured value if level is null

public void SetLogLevel(string category, LogLevel? level)

Parameters

category string

Namespace/qualified class name

level LogLevel?

Minimum level to log, pass null to reset