현재 서버 오류가 발생할 때 .NET 상태 모니터링 클래스를 사용하여 이메일을 보내고 있습니다. 그러나 POST 데이터에 대한 정보를 얻지 못하고 제기 된 이벤트에서 POST 데이터를 가져 오는 방법을 찾을 수 없습니다.상태 모니터링 전자 메일에 POST 데이터를 포함시키는 방법은 무엇입니까?
public class EmailWebEvents : WebEventProvider {
public override void ProcessEvent(WebBaseEvent raisedEvent) {
BasicEmail email = new BasicEmail();
email.To = "[email protected]";
email.Subject = "Website Error (" + Environment.MachineName + ")";
email.Body = raisedEvent.Message + "\n\n" +
raisedEvent.EventSource.ToString() + "\n\n" +
raisedEvent.ToString();
email.Send();
}
public override void Shutdown() {
// Nothing needed to be done.
}
public override void Flush() {
// Nothing needed to be done.
}
}
웹 구성
<system.web>
<healthMonitoring enabled="true" heartbeatInterval="0">
<providers>
<clear />
<add name="Custom Email Event Provider" type="MvcRoot.Helpers.EmailWebEvents" />
</providers>
<rules>
<clear />
<add name="appDevEvents" eventName="All Errors" provider="Custom Email Event Provider" profile="Critical" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom="" />
</rules>
</healthMonitoring>
</system.web>
가 어떻게 이러한 이메일에서 POST 데이터를 포함 할 수 있습니다 C#을?