Introduction 'web.config' file. The 'eventmapping' element is where you specify your provider and 'rules' elements helps you tie up the event with the provider.
...
... 'Web' , ' msgraised' and 'WebProcessStatistics'. By using ' msgcreated' and ' msgraised' we can track at what time event is created and raised. 'Web 'Web 'FormatCustomEventDetails' method with the message we want to log in the eventviewer. Note, we have used 'Web 'FormatCustomEventDetails' we are appending the result in the audit event.
namespace WcfService3
{
[ServiceContract]
public interface IService1
{
[OperationContract]
string Audit();
}
}
In the 'Audit' function We are going to implement our health monitering functionality in health operation contract. In the Service1.svc.cs class implement the 'Audit' function by creating the 'CustomAudit' object and calling the 'Raise' 'web.config' and under 'system.web' element and add the 'healthmonitoring' tag. Specify 'CustomAudit' class in the 'eventMappinga' element and mapping of the class with event viewer in the 'rules' element tag as shown in the below code snippet.
So let's add a ASPX button, consume the client service and call the 'Audit' function in the button click event as shown in below code snippets. 'audit' method and displaying the result of the 'audit' method.
Run the web application which is consuming the WCF service and press the button to invoke the WCF audit function. The 'Audit' function internally calls the 'Raise' bottom of this article
Co-authors
Shivprasad Koirala
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend