Table of Contents

Class EntLibLoggingProxyTraceListener

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

Proxy listener for writing the log using the Logger class.

public class EntLibLoggingProxyTraceListener : TraceListener, IDisposable
Inheritance
EntLibLoggingProxyTraceListener
Implements
Inherited Members

Constructors

EntLibLoggingProxyTraceListener()

public EntLibLoggingProxyTraceListener()

Properties

CategoriesXPathQueries

Gets the xpath queries for the categories.

public IList<string> CategoriesXPathQueries { get; }

Property Value

IList<string>

The xpath queries for the categories.

IsThreadSafe

Gets the value indicating the receiver is thread safe.

public override bool IsThreadSafe { get; }

Property Value

bool

NamespaceManager

Gets the Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener.xmlNamespaceManager for the listenter.

public XmlNamespaceManager NamespaceManager { get; }

Property Value

XmlNamespaceManager

The Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EntLibLoggingProxyTraceListener.xmlNamespaceManager for the listenter.

Methods

GetSupportedAttributes()

Gets the supported attributes, namely "categoriesXPathQueries" and "namespaces".

protected override string[] GetSupportedAttributes()

Returns

string[]

SplitNamespacesString(string)

Splits a namespace string.

public static IDictionary<string, string> SplitNamespacesString(string namespacesString)

Parameters

namespacesString string

The string to split.

Returns

IDictionary<string, string>

The string split into keys and values.

SplitXPathQueriesString(string)

Splits the XPathQuery strings.

public static IList<string> SplitXPathQueriesString(string xpathsStrings)

Parameters

xpathsStrings string

The XPath queries.

Returns

IList<string>

A list of xpaths.

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

Writes trace information, a data object and event information through the Logging Application Block.

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

Parameters

eventCache TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source string

An identification of the source of the trace request.

eventType TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id int

A numeric identifier for the event.

data object

The trace data to emit.

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

Writes trace information, a message, and event information through the Logging Application Block.

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

Parameters

eventCache TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source string

An identification of the source of the trace request.

eventType TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id int

A numeric identifier for the event.

message string

A message to write.

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

Writes trace information, a formatted array of objects and event information through the Logging Application Block.

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

Parameters

eventCache TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source string

An identification of the source of the trace request.

eventType TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id int

A numeric identifier for the event.

format string

A format string that contains zero or more format items, which correspond to objects in the args array.

args object[]

An object array containing zero or more objects to format.

TraceTransfer(TraceEventCache, string, int, string, Guid)

Writes trace information, a message, a related activity identity and event information.

public override void TraceTransfer(TraceEventCache eventCache, string source, int id, string message, Guid relatedActivityId)

Parameters

eventCache TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source string

A name used to identify the output, typically the name of the application that generated the trace event.

id int

A numeric identifier for the event.

message string

A message to write.

relatedActivityId Guid

A Guid object identifying a related activity.

Remarks

The relatedActivityId is saved to a LogEntry so the logging infrastructure can reconstruct the transfer message.

Write(string)

Writes the specified message through the Logging Application Block.

public override void Write(string message)

Parameters

message string

WriteLine(string)

Writes the specified message through the Logging Application Block.

public override void WriteLine(string message)

Parameters

message string