使用Asp.net 2.0内建的健康状态监听器(health monitoring)

只需要在Web.config进行几个简单设置, 即可通过health monitoring将没有处理的错误信息发送到指定Email.

请关注: <healthMonitoring />和<system.Net />两个节点的设置.

<?xml version="1.0"?>
<configuration>
   
<appSettings/>
   
<connectionStrings/>

   
<system.web>
      
<compilation debug="false" />
      
<trace enabled="true" localOnly="false" />

      
<healthMonitoring enabled="true">
         
<providers>
            
<add name="EmailProvider" 
               type
="System.Web.Management.SimpleMailWebEventProvider" 
               from
="you@domain.com" 
               to
="you@domain.com" 
               subjectPrefix
="Error: " 
               buffer
="true" 
               bufferMode
="Notification" />
         
</providers>
         
<rules>
            
<add provider="EmailProvider" name="All App Events" eventName="All Errors" />
         
</rules>
      
</healthMonitoring>

   
</system.web>
   
<system.net>
      
<mailSettings>
         
<smtp from="you@domain.com">
            
<network host="smtp.domain.com" />
         
</smtp>
      
</mailSettings>
   
</system.net>
</configuration> 



详细请查看:  Mads KristensenHealth monitoring in ASP.NET 2.0
Health Monitoring in ASP.NET 2.0: Raising Custom Events
posted @ 2007-08-10 16:00 MK2 阅读(144) 评论(0)  编辑 收藏 所属分类: 1 .NET 2.0/1.1 & 3.X

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2007-12-29 01:47 编辑过
 
另存  打印
最新IT新闻:
· Opera提出网络标准课程 发布标准教育倡议
· SubSonic 2.1 版本发布
· 语义搜索领跑后google搜索引擎
· 2008年7月9日科技博客精选
· Google推出免费虚拟现实服务 用户至少13岁