Detailed description of page. Trace tracing debugging

Source: Internet
Author: User

In fact, this article mainly describes how to use trace at two application levels:

GenerallySet a breakpoint for tracking, Or bothManually generate variable output debugging bugThis will not only waste time, but also
Sometimes you forget to delete your own variables.

. NET provides the trace class,This problem can be effectively solved.

tracing debugging
tracking:
1. page-level tracking:
the following page commands are included at the beginning of the page: <% @ page trace = "true" tracemode = "sortbycategory/sortbytime" %>
Custom message:
trace. write ("here is the string to be displayed");
trace. warn ("here is the string to be displayed"); // with trace. write is the same, but the font is red
check whether trace is used
example: If (trace. isenabled) {trace. warn ("tracking enabled")}

2. ApplicationProgramLevel tracking: 
In the <system. Web> section of the web. config file, <trace enabled = "true" pageoutput = "true"/>

Summary:
Such a statement trace. Write ("here is the string to be displayed"); like a comment, vs. Net does not compile it even if it is not deleted.

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.