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
Open the source file for your application. For example, the <RoleName>.cs file for the worker role or web role.
Add the following using statement if it has not already been added:
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.
Save the file.