We are working on a web application. All pages of this web application inherits from a base page, and we have a mechanism like
this.Error += new EventHandler( Page_Error );
private void Page_Error( object sender, EventArgs e )
{
Helper.LogError( this.Context );
}
The above works pretty fine in all webpages.
Now we want to add couple of web services in our application. We also have a Base Service from which all other services will be inherited. However I am not able to setup a proper error loggin mechanism in webservice so far. Becase, I am not able to identify any event on which I could get the error info without putting Try Catch at respective service method calls.
Can someone suggest a strategy in such cases to have a commong generic error handling mechanism for web services.