Client-side Tracing and Request Tracking in Windows Azure Caching
Client-side tracing and request tracking are two new supportability features of the Windows Azure Caching. Client-side tracing enables you to log diagnostic data for your Windows Azure cache client. Request tracking is a feature that Microsoft can use to troubleshoot and diagnose problems with your request in the cloud.
Applications that use Windows Azure caching are referred to as cache clients. These cache clients make calls into the caching assemblies on the client machine. The caching assemblies then route requests to the cloud. When client-side tracing is enabled, the caching assemblies produce tracing output. Among other things, this tracing output includes information about individual cache client requests. There are two types of tracing supported:
DiagnosticSink traces use standard Windows Azure diagnostics to record this data. For more information, see Collecting Logging Data by Using Windows Azure Diagnostics. EtwSink cannot be used for Windows Azure tracing; it uses Event Tracing for Windows (ETW) to record the trace data for on-premises Windows Server AppFabric caching.
The following sections describe two ways of enabling client-side tracing.
Configuration File Option
Some applications choose to configure their cache clients using configuration settings in the application configuration file or web.config file. For this type of configuration, you can add a tracing element as a child of the datacacheclient element to enable client-side tracing. The following example shows these two elements without showing the complete configuration file:
<dataCacheClient> <tracing sinkType="DiagnosticSink" traceLevel="Verbose"/> <!-- ... --> </dataCacheClient>
Note that the sinkType attribute can be one of two values related to the two types of tracing: DiagnosticSink or EtwSink. As stated previously, Windows Azure tracing should use DiagnosticSink. The traceLevel corresponds to the values in the System.Diagnostics.TraceLevel enumeration.
Finally, note that the actual trace listener should be enabled in the web.config or app.config files. For more information, see How to Initialize the Windows Azure Diagnostic Monitor
Some applications choose to configure their cache clients programmatically. For these clients, a new SetSink method has been added to the DataCacheClientLogManager class. It takes two parameters:
traceSink: specifies the type of tracing. This can either be DataCacheTraceSink.DiagnosticSink or DataCacheTraceSink.EtwSink.
traceLevel: specifies the tracing level. This corresponds to the values in the System.Diagnostics.TraceLevel enumeration.
|If you create an application, you’ll most likely want to allow the user to externally change the logging level depending on the specific problem. The traceLevel parameter allows you to change the logging level in a running application without rebuilding. Of course, if you hard-code a value for this parameter, then you will have to rebuild to change the logging level.|
The following code sets the logging level to verbose:
Request tracking is a feature that enables Microsoft to track individual cache client requests. This can be used to diagnose potential problems or understand unexpected failures. This feature is automatically enabled when client-side tracing is enabled. Each request to the Windows Azure cache has a request identifier (GUID) attached to it. This request identifier is available from the client-side logs. Microsoft can potentially request and use this identifier to understand the history of the request in the cloud.
When request tracking is enabled, the log files that you collect will display the request tracking numbers. To find these numbers, look for the text “Request Tracking Id generated” followed by the request tracking id.
|Although it is useful to understand request tracking and its connection to client-side tracing, this is not a feature that customers directly use. It is only helpful when requested directly by Microsoft support or product teams.|