Open sandboxFocus

Class TraceSourceLoggingBackend

Logging backend that logs using PostSharp.Patterns.Diagnostics.Backends.TraceSource.

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

To use this backend, assign a new instance to DefaultBackend when the application starts. By default, the backend writes the records of each logged type to a separate TraceSource named after the full name of the type. To write to a single trace source, set GetTraceSourceName.

When TraceSourceCollectingTraceListener collects the events of your manual logging, make the backend write to a trace source whose listeners are the output listeners, not the collecting one.

Constructors

Name Description
TraceSourceLoggingBackend()

Initializes a new instance of the TraceSourceLoggingBackend class.

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.

CreateTypeSourceBySourceName(LoggingNamespaceSource, string)

Creates a LoggingTypeSource for the given role and logger name.

GetTextBackendOptions()

Gets the options.

GetTraceSource(string)

Gets a TraceSource of a given name.

See Also