1
votes

We use the Azure Service Bus Relay to expose internal WCF services externally, but when trying to correspond our external service usage with IIS logs - we come up short since there are no entries for Service Bus relay requests in the web server log. This makes sense since we establish an outbound HTTP request to the cloud relay and all requests are serviced via this host connection (we are using HttpRelayBinding).

Is there any way to create IIS log entries when servicing relay requests, or must we resort to WCF diagnostic logging to track our relay usage? Our goal is to reconcile our Azure billing (transactions/month) to our actual relay usage. Has anyone else tried this or found a simple solution for tracking or monitoring service bus relay traffic?

1

1 Answers

1
votes

I am not aware of a mechanism for writing to IIS log directly.

If you need to log the number of requests/responses with status code, you can add a custom IMessageInspector to your service (it can be added via a custom WCF Service behavior). The response message will have HttpResponseMessageProperty which will include the HTTP status code. With this approach, you can log the data in the similar format as the one created by IIS.