Class TraceListenerData
- Assembly
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
Represents the configuration for a TraceListener.
public class TraceListenerData : NameTypeConfigurationElement
- Inheritance
-
TraceListenerData
- Derived
Remarks
Since trace listeners are not under our control, the building mechanism can't rely on annotations to the trace listeners to determine the concrete TraceListenerData subtype when deserializing. Because of this, the schema for TraceListenerData includes the actual type of the instance to build.
Constructors
TraceListenerData()
Initializes an instance of the TraceListenerData class.
public TraceListenerData()
TraceListenerData(string, Type, TraceOptions)
Initializes an instance of TraceListenerData with a name and TraceOptions for a TraceListenerType.
protected TraceListenerData(string name, Type traceListenerType, TraceOptions traceOutputOptions)
Parameters
name
stringThe name for the instance.
traceListenerType
TypeThe trace listener type.
traceOutputOptions
TraceOptionsThe trace options.
TraceListenerData(string, Type, TraceOptions, SourceLevels)
Initializes an instance of TraceListenerData with a name, a TraceOptions for a TraceListenerType and a SourceLevels for a Filter.
protected TraceListenerData(string name, Type traceListenerType, TraceOptions traceOutputOptions, SourceLevels filter)
Parameters
name
stringThe name for the instance.
traceListenerType
TypeThe trace listener type.
traceOutputOptions
TraceOptionsThe trace options.
filter
SourceLevelsThe filter.
TraceListenerData(Type)
Initializes an instance of TraceListenerData for the given traceListenerType
.
public TraceListenerData(Type traceListenerType)
Parameters
traceListenerType
TypeType of trace listener this element represents.
Fields
asynchronousBufferSizeProperty
Name of the property that holds the asynchronous buffer size of a TraceListenerData
protected const string asynchronousBufferSizeProperty = "asynchronousBufferSize"
Field Value
asynchronousDisposeTimeoutProperty
Name of the property that holds the asynchronous dispose timeout of a TraceListenerData
protected const string asynchronousDisposeTimeoutProperty = "asynchronousDisposeTimeout"
Field Value
asynchronousMaxDegreeOfParallelismProperty
Name of the property that holds the asynchronous max degree of parallelism of a TraceListenerData
protected const string asynchronousMaxDegreeOfParallelismProperty = "asynchronousDegreeOfParallelism"
Field Value
asynchronousProperty
Name of the property that holds the asynchronous flag of a TraceListenerData
protected const string asynchronousProperty = "asynchronous"
Field Value
filterProperty
Name of the property that holds the Filter of a TraceListenerData
protected const string filterProperty = "filter"
Field Value
listenerDataTypeProperty
Name of the property that holds the type for a TraceListenerData.
protected const string listenerDataTypeProperty = "listenerDataType"
Field Value
Remarks
This property will hold the type of the object it holds it. However, it's used during the deserialization process when the actual type of configuration element to create has to be determined.
traceOutputOptionsProperty
Name of the property that holds the TraceOptions of a TraceListenerData.
protected const string traceOutputOptionsProperty = "traceOutputOptions"
Field Value
Properties
Asynchronous
Gets or sets the asynchronous flag for the represented TraceListener
public bool Asynchronous { get; set; }
Property Value
AsynchronousBufferSize
Gets or sets the asynchronous buffer size for the represented TraceListener
public int AsynchronousBufferSize { get; set; }
Property Value
AsynchronousDisposeTimeout
Gets or sets the asynchronous dispose timeout for the represented TraceListener
[TypeConverter(typeof(TimeSpanOrInfiniteConverter))]
public TimeSpan AsynchronousDisposeTimeout { get; set; }
Property Value
AsynchronousMaxDegreeOfParallelism
Gets or sets the asynchronous max degree of parallelism for the represented TraceListener
public int? AsynchronousMaxDegreeOfParallelism { get; set; }
Property Value
- int?
Filter
Gets or sets the Filter for the represented TraceListener
public SourceLevels Filter { get; set; }
Property Value
ListenerDataType
Gets or sets the type of the actual TraceListenerData type.
public Type ListenerDataType { get; set; }
Property Value
Remarks
Should match the this.GetType().
ListenerDataTypeName
Gets or sets the fully qualified name of the actual TraceListenerData type.
[Browsable(false)]
public string ListenerDataTypeName { get; set; }
Property Value
- string
the fully qualified name of the actual TraceListenerData type.
TraceOutputOptions
Gets or sets the TraceOptions for the represented TraceListener.
public TraceOptions TraceOutputOptions { get; set; }
Property Value
Methods
BuildFormatterSafe(LoggingSettings, string)
Builds the log formatter represented by the name formatterName
in settings
.
protected ILogFormatter BuildFormatterSafe(LoggingSettings settings, string formatterName)
Parameters
settings
LoggingSettingsThe logging settings.
formatterName
stringThe formatter name, or a null or empty string.
Returns
- ILogFormatter
A new formatter if
formatterName
is not null or empty; otherwise, null.
BuildTraceListener(LoggingSettings)
Builds the TraceListener object represented by this configuration object.
public TraceListener BuildTraceListener(LoggingSettings settings)
Parameters
settings
LoggingSettingsThe logging configuration settings.
Returns
- TraceListener
A trace listener.
CoreBuildTraceListener(LoggingSettings)
Builds the TraceListener object represented by this configuration object.
protected virtual TraceListener CoreBuildTraceListener(LoggingSettings settings)
Parameters
settings
LoggingSettingsThe logging configuration settings.
Returns
- TraceListener
A trace listener.