Question on logging errors in WCF -
I have applied a class that applies the ICRRhandle interface to log WCF errors. The only thing I want to do is log in, which identifies the user with an exception that is related to my service when it arises. All of my logging is in the HandleError () method of the IErrorHandler interface, but because HandleError () can not reference the current operation, I can not get SecurityContext. PRIMARYIdentity I have come up with the following code to capture those code which can not be available in the HandleError method, but I'm not sure that it will work in all cases.
Public category MyErrorHandler: IErrorHandler {Personal Identity Identification; Public Child Handler (Exception Error) {// Do something with the return of identity; } Public Zero providerfilter (exception error, message version, ref message error) {this.identity = Operation.Current.SecurityContext.PrimaryIdentity; }}
The above code is working, but is there anybody available?
Thank you!
For some reason, I thought that the class was made every time there was an exception.
Comments
Post a Comment