Open sandboxFocus

Class TraceSourceCollectingTraceListener

A TraceListener that redirects all trace events to PostSharp. It uses the name of the event source that created the event as the name of the log source to be sent to PostSharp.

Inheritance
TraceSourceCollectingTraceListener
Implements
Namespace: PostSharp.Patterns.Diagnostics.Backends.TraceSource
Assembly: PostSharp.Patterns.Diagnostics.Backends.Tracing.dll
Syntax
public class TraceSourceCollectingTraceListener : BaseCollectingTraceListener, IDisposable
Remarks

Add this listener, for example in app.config, to the trace source that your code uses for manual logging. Then set GetTraceSourceName so that the TraceSourceLoggingBackend writes to a different trace source, configured with the output listeners. Manual and automatic log records then go through the same backend.

Constructors

Name Description
TraceSourceCollectingTraceListener()

Methods

Name Description
TraceCore(string, TraceEventType, string)

Sends an event to PostSharp. You provide the text in its final formatted form.

TraceCore(string, TraceEventType, string, object[])

Sends an event to PostSharp. The text is provided as a formatting string and an array of parameters.

See Also