Class FormattedTraceListenerBase
- Assembly
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
Base class for TraceListeners that deal with formatters.
public abstract class FormattedTraceListenerBase : TraceListener, IDisposable
- Inheritance
-
FormattedTraceListenerBase
- Implements
- Derived
- Inherited Members
Constructors
FormattedTraceListenerBase()
Initalizes a new instance of FormattedTraceListenerBase.
protected FormattedTraceListenerBase()
FormattedTraceListenerBase(ILogFormatter)
Initalizes a new instance of FormattedTraceListenerBase with a ILogFormatter.
protected FormattedTraceListenerBase(ILogFormatter formatter)
Parameters
formatter
ILogFormatterThe ILogFormatter to use when tracing a LogEntry.
Properties
Formatter
The ILogFormatter used to format the trace messages.
public ILogFormatter Formatter { get; set; }
Property Value
IsThreadSafe
Specifies whether this TraceListener is threadsafe
public override bool IsThreadSafe { get; }
Property Value
Methods
TraceData(TraceEventCache, string, TraceEventType, int, object)
Overriding TraceData method for the base TraceListener class because it calls the private WriteHeader and WriteFooter methods which actually call the Write method again and this amounts to multiple log messages
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
Parameters
eventCache
TraceEventCacheThe context information provided by System.Diagnostics.
source
stringThe name of the trace source that delivered the trace data.
eventType
TraceEventTypeThe type of event.
id
intThe id of the event.
data
objectThe data to trace.