跟踪和调试设置架构Trace and Debug Settings Schema

跟踪和调试设置指定用于收集、存储和路由消息的跟踪侦听器以及对跟踪开关设置的级别。Trace and debug settings specify trace listeners that collect, store, and route messages, and the level where a trace switch is set.

下表介绍每个跟踪和调试设置元素的功能。The following table describes the function of each trace and debug settings element.

元素Element 描述Description
<add> 将侦听器添加到跟踪源的 Listeners 集合中。Adds a listener to the Listeners collection for a trace source.
<add> 将侦听器添加到 Listeners 集合中。Adds a listener to the Listeners collection.
<add> 将侦听器添加到 sharedListeners 集合中。Adds a listener to the sharedListeners collection.
<add> 指定对跟踪开关设置的级别。Specifies the level where a trace switch is set.
<assert> 指定调用 Debug.Assert 方法时是否显示消息框;另外指定要写入消息的文件的名称。Specifies whether to display a message box when you call the Debug.Assert method; also specifies the name of the file to write messages to.
<clear> 清除跟踪源的 Listeners 集合。Clears the Listeners collection for a trace source.
<clear> 清除跟踪的 Listeners 集合。Clears the Listeners collection for trace.
<filter> 将筛选器添加到跟踪源的 Listeners 集合中的侦听器。Adds a filter to a listener in the Listeners collection for a trace source.
<filter> 将筛选器添加到跟踪的 Listeners 集合中的侦听器。Adds a filter to a listener in the Listeners collection for trace.
<filter> 将筛选器添加到 sharedListeners 集合中的侦听器。Adds a filter to a listener in the sharedListeners collection.
<listeners> 指定跟踪源的 Listeners 集合中的侦听器。Specifies listeners for the Listeners collection for a trace source.
<listeners> 指定跟踪的 Listeners 集合中的侦听器。Specifies listeners for the Listeners collection for trace.
<performanceCounters> 指定由性能计数器共享的全局内存的大小。Specifies the size of the global memory shared by performance counters.
<remove> 从跟踪的 Listeners 集合中删除侦听器。Removes a listener from the Listeners collection for trace.
<remove> 从跟踪源的 Listeners 集合中删除侦听器。Removes a listener from the Listeners collection for a trace source.
<sharedListeners> 包含任何源或跟踪元素可以引用的侦听器。Contains listeners that any source or trace element can reference.
<sources> 包含用于启动跟踪消息的跟踪源。Contains trace sources that initiate tracing messages.
<source> 指定用于启动跟踪消息的跟踪源。Specifies a trace source that initiates tracing messages.
<switches> 包含跟踪开关和对该跟踪开关设置的级别。Contains trace switches and the level where the trace switches are set.
<system.diagnostics> 指定用于收集、存储和路由消息的跟踪侦听器以及对跟踪开关设置的级别。Specifies trace listeners that collect, store, and route messages and the level where a trace switch is set.
<trace> 包含用于收集、存储和路由跟踪消息的侦听器。Contains listeners that collect, store, and route tracing messages.

请参阅See also