简体   繁体   中英

Azure Service Bus Relay - Monitoring Request Traffic

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM