Table of Contents

Class FormattedTraceListenerWrapperBase

Namespace
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners
Assembly
Microsoft.Practices.EnterpriseLibrary.Logging.dll

Base class for Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners that wrap other trace listeners and use a ILogFormatter to format the trace information.

public abstract class FormattedTraceListenerWrapperBase : FormattedTraceListenerBase, IDisposable
Inheritance
FormattedTraceListenerWrapperBase
Implements
Derived
Inherited Members

Constructors

FormattedTraceListenerWrapperBase()

protected FormattedTraceListenerWrapperBase()

FormattedTraceListenerWrapperBase(TraceListener)

Initializes a FormattedTraceListenerWrapperBase with an inner TraceListener.

protected FormattedTraceListenerWrapperBase(TraceListener innerListener)

Parameters

innerListener TraceListener

The wrapped listener.

FormattedTraceListenerWrapperBase(TraceListener, ILogFormatter)

protected FormattedTraceListenerWrapperBase(TraceListener innerListener, ILogFormatter formater)

Parameters

innerListener TraceListener

The wrapped listener.

formater ILogFormatter

The formatter.

Properties

InnerListener

Gets the TraceListener wrapped.

public TraceListener InnerListener { get; }

Property Value

TraceListener

The TraceListener wrapped.

Methods

Dispose(bool)

Deal with resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true if called from a Dispose message.

TraceData(TraceEventCache, string, TraceEventType, int, object)

Formats the object to trace and forward the trace request to the wrapped listener with the formatted result.

public override void TraceData(TraceEventCache eventCache, string source, TraceEventType severity, int id, object data)

Parameters

eventCache TraceEventCache

The context information.

source string

The trace source.

severity TraceEventType

The severity.

id int

The event id.

data object

The object to trace.

Remarks

Formatting is only performed if the object to trace is a LogEntry and the formatter is set.

TraceData(TraceEventCache, string, TraceEventType, int, params object[])

Forwards the trace request to the wrapped listener.

public override void TraceData(TraceEventCache eventCache, string source, TraceEventType severity, int id, params object[] data)

Parameters

eventCache TraceEventCache

The context information.

source string

The trace source.

severity TraceEventType

The severity.

id int

The event id.

data object[]

The objects to trace.

TraceEvent(TraceEventCache, string, TraceEventType, int, string)

Forwards the trace request to the wrapped listener.

public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType severity, int id, string message)

Parameters

eventCache TraceEventCache

The context information.

source string

The trace source.

severity TraceEventType

The severity.

id int

The event id.

message string

The message to trace.

TraceEvent(TraceEventCache, string, TraceEventType, int, string, params object[])

Forwards the trace request to the wrapped listener.

public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType severity, int id, string format, params object[] args)

Parameters

eventCache TraceEventCache

The context information.

source string

The trace source.

severity TraceEventType

The severity.

id int

The event id.

format string

The format to use.

args object[]

The objects to trace.

Write(string)

Forwards the trace request to the wrapped listener.

public override void Write(string message)

Parameters

message string

The message to trace.

WriteLine(string)

Forwards the tracing to the wrapped listener.

public override void WriteLine(string message)

Parameters

message string

The message to trace.