Custom Logging In WCF service
I have a WCF project that has an exposed API. I want to log requests and responses from my server. I have adjusted the web.config file to do some logging via the system.diagnostics section in the config. I was able to get the logs to begin logging however I would like to be able to more customly log. I’ve been looking around and have found that I can make new classes that implement IEndpointBehavior, BehaviorExtensionElement, IDispatchMessageInspector although I haven’t been able to get it log and not stop calls to the API from working (being processed). I’m still quite confused based on microsoft’s documentation. Could someone give me an explanation of how to use the provided class extensions to create logging that will log requests and response of a specific operation contracts (GetRateLandedCost(RateRequest request) & ShipParcel(routingDeliveryRequest request)) that have certain body values (Both RateRequest and RoutingDeliveryRequest have an “AccountNumber” field for filtering)?