Delen via


<diagnostics>

The diagnostics element defines settings that can be used by an administrator for run-time inspection and control.

Schema Hierarchy

<system.serviceModel>
  <diagnostics>

Syntax

<system.serviceModel>
   <diagnostics wmiProviderEnabled="Boolean"
       performanceCounters="Off/ServiceOnly/All/Default">
       <messageLogging logEntireMessage="Boolean"
          logMalformedMessages="Boolean"
          logMessagesAtServiceLevel="Boolean"
          logMessagesAtTransportLevel="Boolean"
                    maxMessagesToLog="Integer"
          maxSizeOfMessageToLog="Integer" >
          <filters>
                            <clear />
          </filters>
       </messageLogging>
   </diagnostics>
</system.serviceModel>

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

wmiProviderEnabled

A Boolean value that specifies whether the WMI provider for the assembly is enabled. The WMI provider is required for user to gain run-time access to the inspection and control features of Windows Communication Foundation (WCF). The default is false.

performanceCounters

Specifies whether performance counters for the assembly are enabled. Valid values are

  • Off: Performance counters are disabled.

  • ServiceOnly: Only performance counters relevant to this service is enabled.

  • All: Performance counters can be viewed at runtime.

  • Default: A single performance counter instance _WCF_Admin is created. This instance is used to enable the collection of SQM data for used by the infrastructure. None of the counter values for this instance are updated and therefore will remain at zero. This is the default value if no configuration is present for WCF.

Child Elements

Element Description

messageLogging

Describes the settings for WCF message logging.

Parent Elements

Element Description

serviceModel

The root element of all WCF configuration elements.

Remarks

The diagnostics section defines the diagnostics settings for all services located in an assembly. It is not possible to define separate diagnostics settings at the service level unless there is only one service in the assembly. Attributes are set according to the requirements of the section.

Example

<diagnostics wmiProviderEnabled="false"
       performanceCounters="all">
       <messageLogging logEntireMessage="true"
          logMalformedMessages="true"
          logMessagesAtServiceLevel="true"
          logMessagesAtTransportLevel="true"
          maxMessagesToLog="42"
          maxSizeOfMessageToLog="42">
         <filters>
         <clear />
    </filters>
       </messageLogging>
</diagnostics>

See Also

Reference

DiagnosticSection
System.ServiceModel.Diagnostics


© 2007 Microsoft Corporation. All rights reserved.
Last Published: 2010-01-05