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.

public ref class DiagnosticSource abstract
public abstract class DiagnosticSource
type DiagnosticSource = class
Public MustInherit Class DiagnosticSource
继承
DiagnosticSource
派生

注解

有关详细信息,请参阅 DiagnosticSource 用户指南For more information, see DiagnosticSource User's Guide.

构造函数

DiagnosticSource()

初始化 DiagnosticSource 类的实例。Initializes an instance of the DiagnosticSource class.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
IsEnabled(String)

验证通知事件是否已启用。Verifies if the notification event is enabled.

IsEnabled(String, Object, Object)

验证通知事件是否已启用。Verifies it the notification event is enabled.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnActivityExport(Activity, Object)

将状态从活动转移到将在进程外发生的某些事件或操作,例如传出 HTTP 请求。Transfers state from an activity to some event or operation, such as an outgoing HTTP request, that will occur outside the process.

OnActivityImport(Activity, Object)

将状态从将在进程外发生的某些事件或操作(例如传入请求)转移到活动。Transfers state to an activity from some event or operation, such as an incoming request, that occurred outside the process.

StartActivity(Activity, Object)

启动 Activity 并写入启动事件。Starts an Activity and writes a start event.

StopActivity(Activity, Object)

停止给定的 Activity,维护全局 Current 活动,并通知使用者 Activity 已停止。Stops the given Activity, maintains the global Current activity, and notifies consumers that the Activity was stopped.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Write(String, Object)

提供记录复杂有效负载的通用方法。Provides a generic way of logging complex payloads.

适用于