You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/azure/app-service/troubleshoot-dotnet-visual-studio.md
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -310,54 +310,56 @@ For information about how to create application logs in WebJobs, see [How to wor
310
310
1. Add a `using System.Diagnostics;` statement to the top of the file.
311
311
312
312
### View the tracing output locally
313
+
313
314
1. Press F5 to run the application in debug mode.
314
315
315
-
The default trace listener writes all trace output to the **Output** window, along with other Debug output. The following illustration shows the output from the trace statements that you added to the `Index` method.
316
+
The default trace listener writes all trace output to the **Output** window, along with other Debug output. The following illustration shows the output from the trace statements that you added to the `Index` method.
316
317
317
318

318
-
319
-
The following steps show how to view trace output in a web page, without compiling in debug mode.
319
+
320
+
The following steps show how to view trace output in a web page, without compiling in debug mode.
320
321
1. Open the application Web.config file (the one located in the project folder) and add a `<system.diagnostics>` element at the end of the file just before the closing `</configuration>` element:
321
322
322
-
``` xml
323
-
<system.diagnostics>
324
-
<trace>
325
-
<listeners>
326
-
<addname="WebPageTraceListener"
327
-
type="System.Web.WebPageTraceListener,
328
-
System.Web,
329
-
Version=4.0.0.0,
330
-
Culture=neutral,
331
-
PublicKeyToken=b03f5f7f11d50a3a" />
332
-
</listeners>
333
-
</trace>
334
-
</system.diagnostics>
335
-
```
323
+
``` xml
324
+
<system.diagnostics>
325
+
<trace>
326
+
<listeners>
327
+
<addname="WebPageTraceListener"
328
+
type="System.Web.WebPageTraceListener,
329
+
System.Web,
330
+
Version=4.0.0.0,
331
+
Culture=neutral,
332
+
PublicKeyToken=b03f5f7f11d50a3a" />
333
+
</listeners>
334
+
</trace>
335
+
</system.diagnostics>
336
+
```
336
337
337
338
The `WebPageTraceListener` lets you view trace output by browsing to `/trace.axd`.
339
+
338
340
1. Add a [trace element](/previous-versions/dotnet/netframework-4.0/6915t83k(v=vs.100)) under `<system.web>` in the Web.config file, such as the following example:
1. In the address bar of the browser window, add *trace.axd* to the URL, and then press Enter (the URL is similar to `http://localhost:53370/trace.axd`).
346
348
1. On the **Application Trace** page, click **View Details** on the first line (not the BrowserLink line).
347
349
348
-
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-traceaxd1.png" alt-text="Screenshot of the Application Trace page in a web browser showing View Details selected on the first line.":::
350
+
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-traceaxd1.png" alt-text="Screenshot of the Application Trace page in a web browser showing View Details selected on the first line.":::
349
351
350
-
The **Request Details** page appears, and in the **Trace Information** section you see the output from the trace statements that you added to the `Index` method.
352
+
The **Request Details** page appears, and in the **Trace Information** section you see the output from the trace statements that you added to the `Index` method.
351
353
352
-
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-traceaxd2.png" alt-text="Screenshot of the Request Details page in a web browser showing a message highlighted in the Trace Information section.":::
354
+
:::image type="content" source="./media/web-sites-dotnet-troubleshoot-visual-studio/tws-traceaxd2.png" alt-text="Screenshot of the Request Details page in a web browser showing a message highlighted in the Trace Information section.":::
353
355
354
-
By default, `trace.axd` is only available locally. If you wanted to make it available from a remote app, you could add `localOnly="false"` to the `trace` element in the *Web.config* file, as shown in the following example:
356
+
By default, `trace.axd` is only available locally. If you wanted to make it available from a remote app, you could add `localOnly="false"` to the `trace` element in the *Web.config* file, as shown in the following example:
However, enabling `trace.axd` in a production app is not recommended for security reasons. In the following sections, you'll see an easier way to read tracing logs in an App Service app.
362
+
However, enabling `trace.axd` in a production app is not recommended for security reasons. In the following sections, you'll see an easier way to read tracing logs in an App Service app.
0 commit comments