Analysis on the use of ASP. NET trace

Source: Internet
Author: User

I. Concept of ASP. NET trace, what is "tracking"

Tracking is a way to monitor the execution of an application when it is running. When developing a. NET application, you can add the tracking and debugging detection function in it, and use this detection function when developing the application and deploying the application. The Trace and Debug classes allow you to record information about errors and application execution to logs, text files, or other devices for subsequent analysis.

Ii. ASP. NET trace: Why should I use tracing?

In the asp era, if you need to understand certain States and variable values of a program during runtime, the Response. Write is usually used on the page for output. The vast majority of the reasons for doing so are caused by the weak operating and development environment of asp. The result is that the output on the page may cause page chaos, not to mention the Response added to the program. write is not easy to manage. Once there are any omissions, it will cause unnecessary misunderstanding to the customer.

The tracking function of asp.net not only tracks the state and variable value of the program at all stages of the program running, but also supports various management functions supported by asp.net itself. It can be displayed along with the Aspx page, or in another place in a special way. As far as I know, it has the following advantages:

1. You can manage the entire website in a unified manner or start it on a single page. By configuring web. config, you can enable tracking for the entire website or use it on the page.

2. The page layout and presentation are not affected.

3. fully reflect the status of cookies and sessions. This is one of the reasons why I used tracking for the first time.

4. fully reflect the process and execution time of each page event.

3. ASP. NET trace tracking on the activation page

1. Use Trace = "true" in <@ page>"

2. Add "Trace. IsEnabled = true;" to the code ;"

3. add your own tracking information:

Trace. Warn ("abc"); // Warn displays red information.

Trace. Write ("def"); // write displays normal color information.

The introduction to ASP. NET trace is here, and I hope it will help you.

  1. ASP. NET naming settings
  2. Analysis on ASP. NET technique to improve application performance
  3. Use of StringBuilder class in ASP. NET skills
  4. ASP. NET control usage tips
  5. Analysis of ASP. NET annotations

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.