Modifica

Condividi tramite


DiagnosticListener Class

Definition

Provides an implementation of the abstract DiagnosticSource class that represents a named place to which a source sends its information (events).

public ref class DiagnosticListener : System::Diagnostics::DiagnosticSource, IDisposable, IObservable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
public class DiagnosticListener : System.Diagnostics.DiagnosticSource, IDisposable, IObservable<System.Collections.Generic.KeyValuePair<string,object>>
type DiagnosticListener = class
    inherit DiagnosticSource
    interface IDisposable
    interface IObservable<KeyValuePair<string, obj>>
type DiagnosticListener = class
    inherit DiagnosticSource
    interface IObservable<KeyValuePair<string, obj>>
    interface IDisposable
Public Class DiagnosticListener
Inherits DiagnosticSource
Implements IDisposable, IObservable(Of KeyValuePair(Of String, Object))
Inheritance
DiagnosticListener
Implements

Remarks

DiagnosticListener is a NotificationSource, which means the returned result can be used to log notifications, but it also has a Subscribe method so notifications can be forwarded arbitrarily. Thus, its job is to forward things from the producer to all the listeners (multi-casting). Generally, you should not be making your own DiagnosticListener but use the default, so that notifications are as public as possible.

For more information on the DiagnosticSource and DiagnosticListener classes, see DiagnosticSource User's Guide.

Constructors

DiagnosticListener(String)

Creates a new DiagnosticListener.

Properties

AllListeners

Gets the collection of listeners for this DiagnosticListener.

Name

Gets the name of this DiagnosticListener.

Methods

Dispose()

Disposes the NotificationListeners.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsEnabled()

Determines whether there are any registered subscribers.

IsEnabled(String, Object, Object)

Checks if any subscriber to the diagnostic events is interested in receiving events with this name. Subscribers indicate their interest using a delegate provided in Subscribe.

IsEnabled(String, Object, Object)

Verifies it the notification event is enabled.

(Inherited from DiagnosticSource)
IsEnabled(String)

Checks whether the DiagnosticListener is enabled.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnActivityExport(Activity, Object)

Invokes the OnActivityExport method of all the subscribers.

OnActivityExport(Activity, Object)

Transfers state from an activity to some event or operation, such as an outgoing HTTP request, that will occur outside the process.

(Inherited from DiagnosticSource)
OnActivityImport(Activity, Object)

Invokes the OnActivityImport method of all the subscribers.

OnActivityImport(Activity, Object)

Transfers state to an activity from some event or operation, such as an incoming request, that occurred outside the process.

(Inherited from DiagnosticSource)
StartActivity(Activity, Object)

Starts an Activity and writes a start event.

(Inherited from DiagnosticSource)
StartActivity<T>(Activity, T) (Inherited from DiagnosticSource)
StopActivity(Activity, Object)

Stops the given Activity, maintains the global Current activity, and notifies consumers that the Activity was stopped.

(Inherited from DiagnosticSource)
StopActivity<T>(Activity, T) (Inherited from DiagnosticSource)
Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>, Action<Activity,Object>, Action<Activity,Object>)

Adds a subscriber, optionally filters events based on their name and up to two context objects, and specifies methods to call when providers import or export activites from outside the process.

Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>)

Adds a subscriber, and optionally filters events based on their name and up to two context objects.

Subscribe(IObserver<KeyValuePair<String,Object>>, Predicate<String>)

Adds a subscriber, and optionally filters events based on their name.

Subscribe(IObserver<KeyValuePair<String,Object>>)

Adds a subscriber.

ToString()

Returns a string with the name of this DiagnosticListener.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
Write(String, Object)

Logs a notification.

Write<T>(String, T) (Inherited from DiagnosticSource)

Extension Methods

SubscribeWithAdapter(DiagnosticListener, Object, Func<String,Boolean>)
SubscribeWithAdapter(DiagnosticListener, Object, Func<String,Object,Object,Boolean>)
SubscribeWithAdapter(DiagnosticListener, Object)

Applies to