What’s the best way to catch and log errors when developing a WCF service layer, and why?
I can think of three ways,
1) Manual try/catches around each method.
2) Leave the responsibility to the WCF engine.
3) Use a third party library such as Enterprise Library Policy Injection/Logging.
I would implement custom IErrorHandler and use log4net
This class also implements IContractBehavior, so you can use it as Attribute on your service contracts.
log4net is quite flexible, so you can log what you need and when you need.