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

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - lifz

延迟加载的一般实现 (ZT)在Struts中使用Validator框架 业界内广为流传的关于项目管理的通俗讲解 IPM 认识到单元测试的重要性 项目小结 SQL Server多事务并发问题 4xx: Client Error 使用者端(浏览器)错误讯息 Audit审计 加密技巧 COM+组件提供的企业级服务 An n-tiered Approach of Asp.Net Stored Procedure Temp Table Excel Template Export .NET企业服务器要点 jsp页面请求过程 asp.net页面处理过程 How to J2EE Asp.net Authorization Asp.net Authentication
捕获asp.net下的未处理异常
lifz · 2006-09-18 · via 博客园 - lifz

对软件开发,有个基本的要求,就是要屏蔽掉未处理的异常,在系统出错的时候显示一个友好的界面给用户,同时,保存错误信息到日志中。在asp.net下,未处理的异常会引发HttpApplication.Error 事件,因此,我们可以很简单地实现这个feature。
1、写一个类实现IHttpModule接口,挂接该事件,在事件处理中执行log的功能;
2、在web.config中的customErrors配置节,指定defaultRedirect,并置mode的值为On。
可以在不重新编译的情况下对已经部署的生产环境进行功能的增加。

我们的做法是在global中的 Application_Error()捕捉并写到log网页文件,方便查看,同时还调用远程服务器的web service直接发送错误,方便我们调试并解决客户问题

WebService不能这么干,因为WS的错误自己就封装到返回消息里面,会拦截不到。用SoapExtension可以达到和IHttpModule类似的效果