wcfloggingiisserver

IIS Log - WCF Service Track Operation Contract Name


We have a website with different types of apps running on IIS.

.NET Core 6 Web API Angular 16 ASPX Web Application (.Net Framework 4.8) WCF service (.Net Framework 4.8)

We have implemented IIS logging to monitor system performance and traffic patterns. However, we are encountering difficulties in differentiating WCF requests due to the consistent cs-uri-stem value (e.g., /myService/myService.svc) assigned to all WCF requests.

We seek a method to capture the [OperationContract] name associated with each WCF request within the IIS logs to enhance our analysis capabilities.

Are there any established techniques or recommended approaches to achieve this goal?

We’ve attempted to find a solution to capture OperationContract names within IIS logs but haven’t been successful in our online search.


Solution

    1. Analyze Logs Together: Use a tool or script to combine the IIS logs with the custom logs generated by your WCF service. This will give you a comprehensive view, allowing you to match each IIS request with the corresponding [OperationContract] name.

    2. Correlation ID: You can include a correlation ID in both the IIS logs (through custom headers) and WCF logs, making it easier to match requests across logs.