Updated: December 7, 2013
Represents the trace listener used for basic Azure logs.
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
Indicates whether the diagnostic monitor trace listener is thread-safe.(Overrides TraceListener.IsThreadSafe.)
The Logs property and set your desired options for scheduled transfers. Additionally, you must have a storage account configured in the ServiceConfiguration.cscfg file. Transferred trace data is located in the WADLogsTable of the storage account.class is used to log trace data for hosted services. All tracing data is stored as a part of Azure logs, and does not transfer to persistent storage by default. To enable transfers to persistent storage, you must configure the
There are two ways to enable tracing for your web or worker role: modifying app.config or web.config, or programmatically calling the System.Diagnostics.Trace.Listeners.Add method.
To enable tracing using web.config or app.config
Add the following code to the web.config or app.config configuration file:
<system.diagnostics> <trace> <listeners> <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> <filter type="" /> </add> </listeners> </trace> </system.diagnostics>
To enable tracing programmatically
Add the following line of code:
This API is not supported in Azure SDK versions 2.5 and higher. Instead, use the diagnostics.wadcfg XML configuration file. For more information, see Collect Logging Data by Using Azure Diagnostics.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.