[ASP. NET password Reading Notes] Application tracking and monitoring

Source: Internet
Author: User
Tags configuration settings

I. Error targeting:
Two configuration settings affect how error information is displayed:

1. custom errors mode-this setting enables or disables custom errors. when custom errors mode is enabled, errors on a page are hidden. this setting has three possible values: On, off, And remoteonly.
When you are redirected to a page with custom errors, a query string variable is automatically passed to the error page. the query string variable, named aspxerrorpath, contains the path of the page that was originally requested.
2. debug mode-When debug mode is enabled, additional information for debugging runtime errors is displayed.

example:








2. Use performance counters
1. launch performance monitor by typing "perfmon" at a command prompt
2. retrieving performance counters in an ASP. NET page
you can use the classes from the system. diagnostics namespace to work with performance counters within your application.
to retrieve an object that represents a participant performance counter, you need to supply the performance counter category name, performance counter name, and performance counter Instance name. for example, the following statements create a counter that represents the total requests performance counter:
dim objcounter as performancecounter
objcounter = new performancecounter ("ASP. net Applications "," Requests total "," _ total _ ")

3. Trace page execution
You can trace the execution of an ASP. NET page by using the trace attribute of the page directive. to enable tracing for a single ASP. NET page, include the following directive at the top of the page: <% @ page trace = "true" %>.
When tracing is enabled for a page, trace information is automatically appended to the bottom of the page.
The trace information provided des the following statistics: request details, trace information, control tree, session state, application state, cookies collection, headers collection,
Form collection, querystring collection, server variables.

To add M trace messages, use either the trace. Warn or trace. Write methods.
Use application-level Trace, you can use a special page, named trace. axd, to view trace information collected from all the pages in your application.
<Configuration>
<System. Web>
<Trace
Enabled = "true"
Requestlimit = "50"
Pageoutput = "false"
Tracemode = "sortbytime"
Localonly = "true"/>
</System. Web>
</Configuration>
4. Process Monitoring
You can modify some attributes of aspnet_wp.exe by setting some items in machine.config, such as memorylimit-the percentage of system memory that the ASP. net Process is allowed to consume. by default, this setting has the value 80, which stands for 80% of system memory. (memorylimit refers to the percentage of physical memory, not the percentage of virtual memory .). There are also requestqueuelimit and shutdowntimeout.
You can alsoProgram You can use the processmodelinfo class to retrieve information about the ASP. net process. the getcurrentprocessinfo method returns information about the ASP. net process currently executing, and the getprocessinfohistory method returns a history of ASP. net processes.

 

 

 

 

 

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.