Table of Contents

Class LoggingSettings

Namespace
Microsoft.Practices.EnterpriseLibrary.Logging.Configuration
Assembly
Microsoft.Practices.EnterpriseLibrary.Logging.dll

Configuration settings for client-side logging applications.

public class LoggingSettings : SerializableConfigurationSection
Inheritance
LoggingSettings

Constructors

LoggingSettings()

Initialize a new instance of the LoggingSettings with default values.

public LoggingSettings()

LoggingSettings(string)

Initialize a new instance of the LoggingSettings using the given name.

public LoggingSettings(string name)

Parameters

name string

The name to use for this instance

LoggingSettings(string, bool, string)

Initialize a new instance of the LoggingSettings using the given values.

public LoggingSettings(string name, bool tracingEnabled, string defaultCategory)

Parameters

name string

The name to use for this instance

tracingEnabled bool

Should tracing be enabled?

defaultCategory string

The default category to use.

Fields

SectionName

Configuration section name for logging client settings.

public const string SectionName = "loggingConfiguration"

Field Value

string

Properties

DefaultCategory

Gets or sets the default logging category.

public string DefaultCategory { get; set; }

Property Value

string

Formatters

Gets the collection of FormatterData configuration elements that define the available ILogFormatters.

public NameTypeConfigurationElementCollection<FormatterData, CustomFormatterData> Formatters { get; }

Property Value

NameTypeConfigurationElementCollection<FormatterData, CustomFormatterData>

LogFilters

Gets the collection of LogFilterData configuration elements that define the available ILogFilters.

public NameTypeConfigurationElementCollection<LogFilterData, CustomLogFilterData> LogFilters { get; }

Property Value

NameTypeConfigurationElementCollection<LogFilterData, CustomLogFilterData>

LogWarningWhenNoCategoriesMatch

Gets or sets the indication that a warning should be logged when a category is not found while dispatching a log entry.

public bool LogWarningWhenNoCategoriesMatch { get; set; }

Property Value

bool

RevertImpersonation

Gets or sets the indication that impersonation should be reverted temporarily while logging, if enabled.

public bool RevertImpersonation { get; set; }

Property Value

bool

SpecialTraceSources

Gets or sets the configuration elements that define the distinguished LogSources: for all events. for missing categories, and for errors and warnings.

public SpecialTraceSourcesData SpecialTraceSources { get; set; }

Property Value

SpecialTraceSourcesData

TraceListeners

Gets the collection of TraceListenerData configuration elements that define the available TraceListeners.

public TraceListenerDataCollection TraceListeners { get; }

Property Value

TraceListenerDataCollection

TraceSources

Gets the collection of TraceSourceData configuration elements that define the available LogSources.

public NamedElementCollection<TraceSourceData> TraceSources { get; }

Property Value

NamedElementCollection<TraceSourceData>

TracingEnabled

Enable or disable trace logging.

public bool TracingEnabled { get; set; }

Property Value

bool

Methods

BuildLogWriter()

Builds the log writer represented by the section.

public LogWriter BuildLogWriter()

Returns

LogWriter

A LogWriter.

GetLoggingSettings(IConfigurationSource)

Retrieves the LoggingSettings section from the configuration source.

public static LoggingSettings GetLoggingSettings(IConfigurationSource configurationSource)

Parameters

configurationSource IConfigurationSource

The Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource to get the section from.

Returns

LoggingSettings

The logging section.