不幸的是這是不可能做到這一點。您可以使用事件日誌查看相關詳細說明,你也可以用錯誤的詳細信息通過電子郵件發送自己:
<healthMonitoring enabled="true" heartbeatInterval="0">
<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" />
</eventMappings>
<providers>
<clear />
<add name="EmailProvider" type="System.Web.Management.SimpleMailWebEventProvider" to="[email protected]" from="[email protected]" buffer="true" bufferMode="Logging" />
<add name="EventLogProvider" type="System.Web.Management.EventLogWebEventProvider" />
</providers>
<rules>
<clear />
<add name="EmailRule" eventName="All Errors" provider="EmailProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" />
<add name="EventLogRule" eventName="All Errors" provider="EventLogProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" />
</rules>
</healthMonitoring>
調整minInterval如果你只希望接收例如通知每小時或每一天。當然,確保你已經爲你的網絡服務器配置了你的電子郵件。例如。
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory pickupDirectoryLocation="C:\MailPickUpFolders\ExampleDomain" />
<network host="localhost" port="25" />
</smtp>
<!--<smtp deliveryMethod="Network">
<network host="yoursever" port="25" />
</smtp>-->
</mailSettings>
</system.net>