Can't get HealthMonitoring to work
Using asp.net 4.0, been trying to follow this:
http://msdn.microsoft.com/en-us/library/ms998306
Also tried using eventlogprovider and the mail provider. Silence. Is there anything I should know about healthmonitoring, like it doesn't work in 4.0?
Currently me web.config looks like this:
<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开发者_Python百科>
<bufferModes>
<add name="Extra Critical Notification"
maxBufferSize="10"
maxFlushSize="5"
urgentFlushThreshold="1"
regularFlushInterval="Infinite"
urgentFlushInterval="00:01:00"
maxBufferThreads="1"
/>
</bufferModes>
</healthMonitoring>
Hope someone can help.
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
精彩评论