惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
B
Blog
WordPress大学
WordPress大学
Project Zero
Project Zero
P
Palo Alto Networks Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
T
Tailwind CSS Blog
Forbes - Security
Forbes - Security
F
Full Disclosure
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hacker News: Ask HN
Hacker News: Ask HN
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
F
Fortinet All Blogs
Cisco Talos Blog
Cisco Talos Blog
G
Google Developers Blog
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
O
OpenAI News
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
IT之家
IT之家
U
Unit 42
腾讯CDC
S
Security Affairs
C
Cisco Blogs
Schneier on Security
Schneier on Security
The Last Watchdog
The Last Watchdog
B
Blog RSS Feed
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss

博客园 - 小诈

[.net]正则表达式整理 今日所思 伟大的意大利夺冠了!疯狂庆祝! word add-in 卸载时如何清除自定义的按钮和菜单 制作包含.net framework的安装包 解决不能上网的问题(Wincock绑架) [ASP.NET揭密读书笔记]额外的控件和资源 [ASP.NET揭密读书笔记]ADO.NET介绍 [ASP.NET揭密读书笔记]用户自定义控件 [ASP.NET揭密读书笔记]连接池 安装Ubuntu 痛苦的胃镜检查 [转载]微软好员工的十个标准 新年新气象,恭喜发财 WEB中服务器端Table的行集中要注意ViewState 2005年年终总结 招聘.NET高级软件工程师 DataTable.Select方法的性能问题 [转贴]Visual Studio 2005常用插件搜罗
[ASP.NET揭密读书笔记]应用程序跟踪和监视
小诈 · 2006-06-26 · via 博客园 - 小诈

一、错误定向:
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.

例如如下的配置文件:
<configuration>
  <system.web>
    <customErrors mode="On" defaultRedirect="AppError.aspx">
      <error statusCode="404" redirect="NotFound.aspx" />
      <error statusCode="500" redirect="AppError.aspx" />
    </customErrors>
    <compilation debug="true" />
  </system.web>
</configuration>

二、使用性能计数器
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 particular 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__" )

三、跟踪(Trace)页面执行
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 includes 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 custom trace messages, use either the Trace.Warn or Trace.Write methods.
使用应用级别的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>
四、进程的监视
通过设置Machine.config中的某些项目可以修改aspnet_wp.exe的一些属性,例如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.)。其他还有requestQueueLimit,shutdownTimeout。
还可以在程序中获取当前进程的信息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.