<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.0-preview.6.21352.12" />

DiagnosticSource

public abstract class DiagnosticSource
An abstract class that allows code to be instrumented for production-time logging of rich data payloads for consumption within the process that was instrumented.
protected DiagnosticSource()

Initializes an instance of the DiagnosticSource class.

public abstract bool IsEnabled(string name)

Verifies if the notification event is enabled.

public virtual bool IsEnabled(string name, object arg1, object arg2 = null)

Verifies it the notification event is enabled.

public virtual void OnActivityExport(Activity activity, object payload)

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

public virtual void OnActivityImport(Activity activity, object payload)

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

public Activity StartActivity(Activity activity, object args)

Starts an Activity and writes a start event.

public void StopActivity(Activity activity, object args)

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

public abstract void Write(string name, object value)

Provides a generic way of logging complex payloads.