I am writing a WCF service and want to keep an activity log: trace, warnings and error messages. A very simple approach is to wrap all the service code inside the try/catch sections and write error messages from the catch part, reconstructing exceptions to service errors of the service.
I suppose it would be nice if there was one code point to catch all the uncaught exceptions instead of dozens of try/catch sections. It would also be useful to write the parameters of the contract method from this point to provide detailed error information.
Is this possible with WCF?
What is the best practice for organizing error handling within WCF services?
Thank you in advance!
Andrew florko
source share