Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DiagnosticMonitorTraceListener Class

DiagnosticMonitorTraceListener Class

 

Updated: December 7, 2013

Represents the trace listener used for basic Azure logs.

Namespace:   Microsoft.WindowsAzure.Diagnostics
Assembly:  Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)

System.Object
  System.MarshalByRefObject
    System.Diagnostics.TraceListener
      Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener

Public Class DiagnosticMonitorTraceListener
	Inherits TraceListener

NameDescription
System_CAPS_pubmethodDiagnosticMonitorTraceListener()

Constructor for the DiagnosticMonitorTraceListener class.

NameDescription
System_CAPS_pubpropertyAttributes

(Inherited from TraceListener.)

System_CAPS_pubpropertyFilter

(Inherited from TraceListener.)

System_CAPS_pubpropertyIndentLevel

(Inherited from TraceListener.)

System_CAPS_pubpropertyIndentSize

(Inherited from TraceListener.)

System_CAPS_pubpropertyIsThreadSafe

Indicates whether the diagnostic monitor trace listener is thread-safe.(Overrides TraceListener.IsThreadSafe.)

System_CAPS_pubpropertyName

(Inherited from TraceListener.)

System_CAPS_protpropertyNeedIndent

(Inherited from TraceListener.)

System_CAPS_pubpropertyTraceOutputOptions

(Inherited from TraceListener.)

NameDescription
System_CAPS_pubmethodClose()

(Inherited from TraceListener.)

System_CAPS_pubmethodCreateObjRef(Type)

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDispose()

(Inherited from TraceListener.)

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.(Overrides TraceListener.Dispose(Boolean).)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodFail(String)

(Inherited from TraceListener.)

System_CAPS_pubmethodFail(String, String)

(Inherited from TraceListener.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodFlush()

(Inherited from TraceListener.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_protmethodGetSupportedAttributes()

(Inherited from TraceListener.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone(Boolean)

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodTraceData(TraceEventCache, String, TraceEventType, Int32, Object)

Writes trace information, a data object and event information to the listener-specific output.(Overrides TraceListener.TraceData(TraceEventCache, String, TraceEventType, Int32, Object).)

System_CAPS_pubmethodTraceData(TraceEventCache, String, TraceEventType, Int32, Object())

Writes trace information, an array of data objects and event information to the listener-specific output.(Overrides TraceListener.TraceData(TraceEventCache, String, TraceEventType, Int32, Object()).)

System_CAPS_pubmethodTraceEvent(TraceEventCache, String, TraceEventType, Int32)

Writes trace and event information to the listener-specific output.(Overrides TraceListener.TraceEvent(TraceEventCache, String, TraceEventType, Int32).)

System_CAPS_pubmethodTraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Writes trace information, a message, and event information to the listener-specific output.(Overrides TraceListener.TraceEvent(TraceEventCache, String, TraceEventType, Int32, String).)

System_CAPS_pubmethodTraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object())

Writes trace information, a formatted array of objects and event information to the listener-specific output.(Overrides TraceListener.TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object()).)

System_CAPS_pubmethodTraceTransfer(TraceEventCache, String, Int32, String, Guid)

(Inherited from TraceListener.)

System_CAPS_pubmethodWrite(Object)

(Inherited from TraceListener.)

System_CAPS_pubmethodWrite(Object, String)

(Inherited from TraceListener.)

System_CAPS_pubmethodWrite(String)

When overridden in a derived class, writes the specified message to the listener you create in the derived class.(Overrides TraceListener.Write(String).)

System_CAPS_pubmethodWrite(String, String)

(Inherited from TraceListener.)

System_CAPS_protmethodWriteIndent()

(Inherited from TraceListener.)

System_CAPS_pubmethodWriteLine(Object)

(Inherited from TraceListener.)

System_CAPS_pubmethodWriteLine(Object, String)

(Inherited from TraceListener.)

System_CAPS_pubmethodWriteLine(String)

When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator.(Overrides TraceListener.WriteLine(String).)

System_CAPS_pubmethodWriteLine(String, String)

(Inherited from TraceListener.)

The DiagnosticMonitorTraceListener 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 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.

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=1.0.0.0, 
            Culture=neutral, 
            PublicKeyToken=31bf3856ad364e35"
            name="AzureDiagnostics">
            <filter type="" />
         </add>
      </listeners>
   </trace>
</system.diagnostics>

To enable tracing programmatically

Add the following line of code:

System.Diagnostics.Trace.Listeners.Add(new Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener());
System_CAPS_warningWarning

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.

Return to top
Show:
© 2015 Microsoft