无法让 HealthMonitoring 工作
使用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="[email protected]"
from="[email protected]"
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>
希望有人可以提供帮助。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HealthMonitoring 在 4.0 中运行良好。
您可能没有在 web.config 中定义 SMTP 服务器
如果您无法使用本地 SMTP 服务器并且只能通过主机/IP/用户名/密码发送邮件,您可以查看这篇文章:http://www.tomot.de/en-us/article/6/asp.net/how-to-create-a-custom-healthmonitoring-provider-that-sends-e-mails
HealthMonitoring works fine in 4.0.
You probably haven't defined a SMTP server in the web.config
If you can't use a local SMTP server and you can only send mails via host/ip/username/password, you might check out this article: http://www.tomot.de/en-us/article/6/asp.net/how-to-create-a-custom-healthmonitoring-provider-that-sends-e-mails