使用asp.net 4.0,一直试图遵循这个:
http://msdn.microsoft.com/en-us/library/ms998306
还尝试使用eventlogprovider和邮件提供程序。安静。有什么我应该知道的关于健康监测的事情,比如它在4.0中不起作用吗?
目前我的web.config看起来像这样:
<healthMonitoring enabled="true" heartbeatInterval="600">
<providers>
<clear/>
<add name="EmailErrorProvider"
type="System.Web.Management.SimpleMailWebEventProvider"
to="martin.camitz@gmail.com"
from="donotreply@cocoin.com"
buffer="false"
subjectPrefix="An error has occured."
bodyHeader="This email is generated from my application." />
<add connectionStringName="MySqlConnection"
maxEventDetailsLength="1073741823"
buffer="true"
bufferMode="Extra Critical Notification"
name="MySqlWebEventProvider"
type="System.Web.Management.SqlWebEventProvider,System.Web,Version=2.0.0 .0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
<rules>
<clear/>
<add name="Testing Mail Event Providers"
eventName="All Errors"
provider="EmailErrorProvider"
profile="Default"
minInstances="1"
maxLimit="Infinite"
minInterval="00:01:00"
custom=""/>
<add name="Critical event"
eventName="My Critical Event"
provider="MySqlWebEventProvider"
profile="Throttle"/>
</rules>
<eventMappings>
<clear/>
<add name="All Errors"
type="System.Web.Management.WebBaseErrorEvent, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
startEventCode="0"
endEventCode="2147483647"/>
<add name="My Critical Event"
type="MyWebEvents.MyCriticalEvent,MyWebEvents"/>
</eventMappings>
<profiles>
<add name="Throttle"
minInstances="1"
maxLimit="1000"
minInterval="00:00:01"/>
</profiles>
<bufferModes>
<add name="Extra Critical Notification"
maxBufferSize="10"
maxFlushSize="5"
urgentFlushThreshold="1"
regularFlushInterval="Infinite"
urgentFlushInterval="00:01:00"
maxBufferThreads="1"
/>
</bufferModes>
</healthMonitoring>
希望有人可以提供帮助。
答案 0 :(得分:1)
HealthMonitoring在4.0中运行良好。
您可能尚未在web.config中定义SMTP服务器
如果您无法使用本地SMTP服务器且只能通过host / ip / username / password发送邮件,则可以查看以下文章:http://www.tomot.de/en-us/article/6/asp.net/how-to-create-a-custom-healthmonitoring-provider-that-sends-e-mails