Logging backend that uses EventSource.
Implements
Namespace: PostSharp.Patterns.Diagnostics.Backends.EventSource
Assembly: PostSharp.Patterns.Diagnostics.Backends.Tracing.dll
Syntax
public class EventSourceLoggingBackend : TextLoggingBackend, IDisposableRemarks
It can be used with ETW or Enterprise Library Semantic Logging.
To use this backend, assign a new instance to DefaultBackend when the application starts.
The default PostSharpEventSource emits events under the provider name PostSharp-Patterns-Diagnostics; enable this
provider in the ETW session that collects the events, for example with PerfView. An EventSource
does not throw when its construction fails, so check ConstructionException of
the EventSource property.
Constructors
| Name | Description |
|---|---|
| EventSourceLoggingBackend() | Initializes a new instance of the EventSourceLoggingBackend class with the default event source. |
| EventSourceLoggingBackend(PostSharpEventSource) | Initializes a new instance of the EventSourceLoggingBackend class and specifies a custom PostSharpEventSource. |
Properties
| Name | Description |
|---|---|
| EventSource | Gets the EventSource to which events will be written. |
| 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. |