aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

WebHookSender : logging retries / response code returned #52

Closed paulduran closed 8 years ago

paulduran commented 8 years ago

We are looking at adding some structured 'audit' logging for our web hook sender so that we have a 'per customer' database of web hook 'events'.

Ideally , we would be able to record:

I think we can get the last item (whether it was success or failure) by overriding the OnWebHookFailure / OnWebHookSuccess methods.

Do you have any suggestions on how we can log 'audit events' in our database for the 'for each retry' events?

HenrikFrystykNielsen commented 8 years ago

Not without overriding a bunch of stuff but we can probably add a virtual OnWebHookRetry method and call that on retries.

HenrikFrystykNielsen commented 8 years ago

This is now in dev branch: 2d5c543d99e914c5f3f8558ace513bc81275195f Should make it to master in a few days.

paulduran commented 8 years ago

Thanks for your assistance there @HenrikFrystykNielsen . Is there a way to get any details of the 'previous' http request when we are retrying , or on success/failure .. such as the duration it took or the response code received?

HenrikFrystykNielsen commented 8 years ago

Nope :) If you want that level of detail then you'll have to either look at the logging output or wire it up yourself. We do log this information but it is more intended for diagnostics.