Skip to content

Commit bec2b2c

Browse files
Merge pull request #281576 from tomvcassidy/15CSDate
ms.date and acrolinx
2 parents fec206b + 9d15d99 commit bec2b2c

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

articles/cloud-services/cloud-services-dotnet-diagnostics-trace-flow.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Trace the flow in Cloud Services (classic) Application with Azure Diagnos
33
description: Add tracing messages to an Azure application to help debugging, measuring performance, monitoring, traffic analysis, and more.
44
ms.topic: article
55
ms.service: cloud-services
6-
ms.date: 02/21/2023
6+
ms.date: 07/23/2024
77
author: hirenshah1
88
ms.author: hirshah
99
ms.reviewer: mimckitt
@@ -14,27 +14,28 @@ ms.custom: compute-evergreen
1414

1515
[!INCLUDE [Cloud Services (classic) deprecation announcement](includes/deprecation-announcement.md)]
1616

17-
Tracing is a way for you to monitor the execution of your application while it is running. You can use the [System.Diagnostics.Trace](/dotnet/api/system.diagnostics.trace), [System.Diagnostics.Debug](/dotnet/api/system.diagnostics.debug), and [System.Diagnostics.TraceSource](/dotnet/api/system.diagnostics.tracesource) classes to record information about errors and application execution in logs, text files, or other devices for later analysis. For more information about tracing, see [Tracing and Instrumenting Applications](/dotnet/framework/debug-trace-profile/tracing-and-instrumenting-applications).
17+
Tracing is a way for you to monitor the execution of your application while it's running. You can use the [System.Diagnostics.Trace](/dotnet/api/system.diagnostics.trace), [System.Diagnostics.Debug](/dotnet/api/system.diagnostics.debug), and [System.Diagnostics.TraceSource](/dotnet/api/system.diagnostics.tracesource) classes to record information about errors and application execution in logs, text files, or other devices for later analysis. For more information about tracing, see [Tracing and Instrumenting Applications](/dotnet/framework/debug-trace-profile/tracing-and-instrumenting-applications).
1818

1919
## Use trace statements and trace switches
20-
Implement tracing in your Cloud Services application by adding the [DiagnosticMonitorTraceListener](/previous-versions/azure/reference/ee758610(v=azure.100)) to the application configuration and making calls to System.Diagnostics.Trace or System.Diagnostics.Debug in your application code. Use the configuration file *app.config* for worker roles and the *web.config* for web roles. When you create a new hosted service using a Visual Studio template, Azure Diagnostics is automatically added to the project and the DiagnosticMonitorTraceListener is added to the appropriate configuration file for the roles that you add.
20+
Implement tracing in your Cloud Services application by adding the [DiagnosticMonitorTraceListener](/previous-versions/azure/reference/ee758610(v=azure.100)) to the application configuration and making calls to System.Diagnostics.Trace or System.Diagnostics.Debug in your application code. Use the configuration file *app.config* for worker roles and the *web.config* for web roles. When you create a new hosted service using a Visual Studio template, Azure Diagnostics is automatically added to the project, and the DiagnosticMonitorTraceListener is added to the appropriate configuration file for the roles that you add.
2121

2222
For information on placing trace statements, see [How to: Add Trace Statements to Application Code](/dotnet/framework/debug-trace-profile/how-to-add-trace-statements-to-application-code).
2323

24-
By placing [Trace Switches](/dotnet/framework/debug-trace-profile/trace-switches) in your code, you can control whether tracing occurs and how extensive it is. This lets you monitor the status of your application in a production environment. This is especially important in a business application that uses multiple components running on multiple computers. For more information, see [How to: Configure Trace Switches](/dotnet/framework/debug-trace-profile/how-to-create-initialize-and-configure-trace-switches).
24+
By placing [Trace Switches](/dotnet/framework/debug-trace-profile/trace-switches) in your code, you can control whether tracing occurs and how extensive it is. Tracing lets you monitor the status of your application in a production environment. Monitoring application status is especially important in a business application that uses multiple components running on multiple computers. For more information, see [How to: Configure Trace Switches](/dotnet/framework/debug-trace-profile/how-to-create-initialize-and-configure-trace-switches).
2525

2626
## Configure the trace listener in an Azure application
27-
Trace, Debug and TraceSource, require you set up "listeners" to collect and record the messages that are sent. Listeners collect, store, and route tracing messages. They direct the tracing output to an appropriate target, such as a log, window, or text file. Azure Diagnostics uses the [DiagnosticMonitorTraceListener](/previous-versions/azure/reference/ee758610(v=azure.100)) class.
27+
Trace, Debug, and TraceSource require you set up "listeners" to collect and record the messages that are sent. Listeners collect, store, and route tracing messages. They direct the tracing output to an appropriate target, such as a log, window, or text file. Azure Diagnostics uses the [DiagnosticMonitorTraceListener](/previous-versions/azure/reference/ee758610(v=azure.100)) class.
2828

29-
Before you complete the following procedure, you must initialize the Azure diagnostic monitor. To do this, see [Enabling Diagnostics in Microsoft Azure](cloud-services-dotnet-diagnostics.md).
29+
Before you complete the following procedure, you must initialize the Azure diagnostic monitor. To initialize the Azure diagnostic monitor, see [Enabling Diagnostics in Microsoft Azure](cloud-services-dotnet-diagnostics.md).
3030

31-
Note that if you use the templates that are provided by Visual Studio, the configuration of the listener is added automatically for you.
31+
> [!NOTE]
32+
> If you use the templates that are provided by Visual Studio, the configuration of the listener is added automatically for you.
3233
3334
### Add a trace listener
3435

3536
1. Open the web.config or app.config file for your role.
3637

37-
2. Add the following code to the file. Change the Version attribute to use the version number of the assembly you are referencing. The assembly version does not necessarily change with each Azure SDK release unless there are updates to it.
38+
2. Add the following code to the file. Change the Version attribute to use the version number of the assembly you're referencing. The assembly version doesn't necessarily change with each Azure SDK release unless there are updates to it.
3839

3940
```xml
4041
<system.diagnostics>
@@ -54,7 +55,7 @@ Note that if you use the templates that are provided by Visual Studio, the confi
5455
```
5556

5657
> [!IMPORTANT]
57-
> Make sure you have a project reference to the Microsoft.WindowsAzure.Diagnostics assembly. Update the version number in the xml above to match the version of the referenced Microsoft.WindowsAzure.Diagnostics assembly.
58+
> Make sure you have a project reference to the Microsoft.WindowsAzure.Diagnostics assembly. Update the version number in the preceding xml to match the version of the referenced Microsoft.WindowsAzure.Diagnostics assembly.
5859
5960
3. Save the config file.
6061

@@ -64,11 +65,11 @@ After you complete the steps to add the listener, you can add trace statements t
6465

6566
### To add trace statement to your code
6667
1. Open a source file for your application. For example, the \<RoleName>.cs file for the worker role or web role.
67-
2. Add the following using directive if it has not already been added:
68+
2. Add the following using directive if it isn't present:
6869
```
6970
using System.Diagnostics;
7071
```
71-
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](/dotnet/framework/debug-trace-profile/how-to-add-trace-statements-to-application-code).
72+
3. Add Trace statements where you want to capture information about the state of your application. You can use various methods to format the output of the Trace statement. For more information, see [How to: Add Trace Statements to Application Code](/dotnet/framework/debug-trace-profile/how-to-add-trace-statements-to-application-code).
7273
4. Save the source file.
7374
7475

0 commit comments

Comments
 (0)