Table of Contents

Class FormattedTraceListenerBase

Namespace
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners
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 ILogFormatter

The ILogFormatter to use when tracing a LogEntry.

Properties

Formatter

The ILogFormatter used to format the trace messages.

public ILogFormatter Formatter { get; set; }

Property Value

ILogFormatter

IsThreadSafe

Specifies whether this TraceListener is threadsafe

public override bool IsThreadSafe { get; }

Property Value

bool

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 TraceEventCache

The context information provided by System.Diagnostics.

source string

The name of the trace source that delivered the trace data.

eventType TraceEventType

The type of event.

id int

The id of the event.

data object

The data to trace.