Open sandboxFocus

Class TraceLoggingBackend

Logging backend that logs using Trace.

Inheritance
TraceLoggingBackend
Implements
Namespace: PostSharp.Patterns.Diagnostics.Backends.Trace
Assembly: PostSharp.Patterns.Diagnostics.Backends.Tracing.dll
Syntax
public class TraceLoggingBackend : TextLoggingBackend, IDisposable
Remarks

To use this backend, assign a new instance to DefaultBackend when the application starts.

To route the events that your code logs directly with Trace through PostSharp Logging, call RedirectLoggingToPostSharp() and pass the listeners it returns to the TraceLoggingBackend(IEnumerable<TraceListener>, string) constructor. The parameterless constructor would write back to Trace, whose only listener is then the collecting one.

Constructors

Name Description
TraceLoggingBackend()

Initializes a new instance of the TraceLoggingBackend class that logs into Trace (the static trace source).

TraceLoggingBackend(IEnumerable<TraceListener>, string)

Initializes a new instance of the TraceLoggingBackend class that logs directly into the given trace listeners.

Properties

Name Description
Options

Gets the backend options.

Methods

Name Description
CreateRecordBuilder()

Creates a new LogRecordBuilder.

CreateTypeSource(LoggingNamespaceSource, Type)

Creates a LoggingTypeSource for the given role and type.

GetTextBackendOptions()

Gets the options.

See Also