SALES: 1-800-867-1380

Use Trace Messages in a Windows Azure Application

Updated: December 2, 2013

The Trace class allows you to instrument your application. You can receive informative messages from your running application that can help diagnose problems or analyze performance. Before you complete the following procedure, you must configure a TraceListener. To do this, see Configure the TraceListener in a Windows Azure Application.

To add trace statements

  1. Open the source file for your application. For example, the <RoleName>.cs file for the worker role or web role.

  2. Add the following using statement if it has not already been added:

    using System.Diagnostics;
  3. Add Trace statements where you want to capture information about the state of your application. You can use a variety of methods to format the output of the Trace statement. For more information, see How to: Add Trace Statements to Application Code.

  4. Save the file.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft