WCF Exception handling with logging app block

Topics: Enterprise Library Core, Exception Handling Application Block, Logging Application Block
Jan 31, 2010 at 2:33 PM


I am using the Exception handling application block to pass fault contracts back to the client in case of an exception in a WCF service. ( I use the
WCF Exception Shielding)
This all works fine.

In addition to converting the exception to my fault exception, I would like to log this exception. In order to log information in my project, I use the logging application block.

Is there a way to configure "WCF Exception Shielding"  policy that I've created, so that the exception that was caught will be sent to the logger (without actually catch the exception, and perform Logger.Write?).

For example, When I use the error handling application block(without WCF), I can add a logging handler to the exception type, and the exception was logged according to the configuration on the logging application block.




Feb 1, 2010 at 6:03 AM


Do you mean, log the exception first on the server side before handling the actual exception? I think you can achieve it by adding a log handler before the fault contract handler.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.