Problem / Background
For logging every request and response out of API Management, I use a log-to-eventhub policy. My goal is to assure that all logged data of every single request / response is transmitted to Event Hubs.
Example Code for log-to-eventhuv-policy
<policies>
<inbound>
<set-variable name="test1" value="1" />
<log-to-eventhub logger-id="CslLog" partition-id="0">@{
return new JObject(
new JProperty("test1", context.Variables["test1"])
).ToString();
}</log-to-eventhub>
<base />
</inbound>
Unfortunately I could not find any documentation about the reliability of the log-to-eventhub policy.
Goals / Questions
- In Case the log-to-eventhub policy can not reach the Event Hub for whatever reasons, a reconnection should be tried.
- If the transmission of logged data of the requests/responses to Event Hubs finally failed, these requests should throw an error.
So far I haven´t found any solution to assure the reliability of transmission of data logged with my log-to-eventhub policy.
Looking forward for your responses.