Class LoggingSettings
- 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
stringThe 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
stringThe name to use for this instance
tracingEnabled
boolShould tracing be enabled?
defaultCategory
stringThe default category to use.
Fields
SectionName
Configuration section name for logging client settings.
public const string SectionName = "loggingConfiguration"
Field Value
Properties
DefaultCategory
Gets or sets the default logging category.
public string DefaultCategory { get; set; }
Property Value
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
RevertImpersonation
Gets or sets the indication that impersonation should be reverted temporarily while logging, if enabled.
public bool RevertImpersonation { get; set; }
Property Value
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
TraceListeners
Gets the collection of TraceListenerData configuration elements that define the available TraceListeners.
public TraceListenerDataCollection TraceListeners { get; }
Property Value
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
Methods
BuildLogWriter()
Builds the log writer represented by the section.
public LogWriter BuildLogWriter()
Returns
GetLoggingSettings(IConfigurationSource)
Retrieves the LoggingSettings section from the configuration source.
public static LoggingSettings GetLoggingSettings(IConfigurationSource configurationSource)
Parameters
configurationSource
IConfigurationSourceThe Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource to get the section from.
Returns
- LoggingSettings
The logging section.