Class LoggingConfiguration
- Namespace
- Microsoft.Practices.EnterpriseLibrary.Logging
- Assembly
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
Represents the configuration options for the Logging Application Block.
public sealed class LoggingConfiguration
- Inheritance
-
LoggingConfiguration
- Inherited Members
Constructors
LoggingConfiguration()
Initializes a new instance of the LoggingConfiguration class.
public LoggingConfiguration()
Properties
AllTraceListeners
Gets a collection of all the TraceListener objects used in this configuration.
public IEnumerable<TraceListener> AllTraceListeners { get; }
Property Value
DefaultSource
Gets or sets the default source name.
public string DefaultSource { get; set; }
Property Value
Filters
Gets the list of all available ILogFilter objects.
public IList<ILogFilter> Filters { get; }
Property Value
IsLoggingEnabled
Gets or sets a value that indicates whether logging is enabled.
public bool IsLoggingEnabled { get; set; }
Property Value
IsTracingEnabled
Gets or sets a value that indicates whether tracing is enabled.
public bool IsTracingEnabled { get; set; }
Property Value
LogSources
Gets the collection of all available LogSource objects.
public LogSourceDataCollection LogSources { get; }
Property Value
LogWarningsWhenNoCategoriesMatch
Gets or sets a value that indicates whether to log warnings when no matching categories are found.
public bool LogWarningsWhenNoCategoriesMatch { get; set; }
Property Value
SpecialSources
Gets the configuration for special sources.
public SpecialSourcesConfiguration SpecialSources { get; }
Property Value
UseImpersonation
Gets or sets a value indicating whether to use impersonation.
public bool UseImpersonation { get; set; }
Property Value
Methods
AddLogSource(string)
Adds a new log source with the specified name.
public LogSourceData AddLogSource(string name)
Parameters
name
stringThe name of the log source.
Returns
- LogSourceData
A new LogSourceData instance.
AddLogSource(string, SourceLevels)
Adds a new log source with the specified name and level.
public LogSourceData AddLogSource(string name, SourceLevels level)
Parameters
name
stringThe name of the log source.
level
SourceLevelsThe filtering level of the log source.
Returns
- LogSourceData
A new LogSourceData instance.
AddLogSource(string, SourceLevels, bool)
Adds a new log source with the specified name and level, and optionally enables auto-flush.
public LogSourceData AddLogSource(string name, SourceLevels level, bool autoFlush)
Parameters
name
stringThe name of the log source.
level
SourceLevelsThe filtering level of the log source.
autoFlush
bool
Returns
- LogSourceData
A new LogSourceData instance.
AddLogSource(string, SourceLevels, bool, params TraceListener[])
Adds a new log source with the specified name, level, and trace listeners, and optionally enables auto-flush.
public LogSourceData AddLogSource(string name, SourceLevels level, bool autoFlush, params TraceListener[] traceListeners)
Parameters
name
stringThe name of the log source.
level
SourceLevelsThe filtering level of the log source.
autoFlush
booltraceListeners
TraceListener[]One or more TraceListener objects.
Returns
- LogSourceData
A new LogSourceData instance.
AddLogSource(string, params TraceListener[])
Adds a new log source with the specified name and trace listeners.
public LogSourceData AddLogSource(string name, params TraceListener[] traceListeners)
Parameters
name
stringThe name of the log source.
traceListeners
TraceListener[]One or more TraceListener objects.
Returns
- LogSourceData
A new LogSourceData instance.