mardi 29 décembre 2015

Are there any way to have some persistent id across request in MVC Web API

I am about to implement log into already existing API. I would like to be able to trace what happend after specific controller action was called.

So user can call http://ift.tt/1kpx56p

In the API GiveMeRandomMonkey call can be like : CallRandomMonkeyService -> DoSomeVoodoo -> CallMonkeyRepository -> ThereAreNoMonkeysLeftException

I would like to trace it all the way and in log be able to see that this reqest had id "20" so i can trace it.

Right now when user call GiveMeRandomMonkey i create new GUId and parse it all the way through the system. Are there any better ways?




Aucun commentaire:

Enregistrer un commentaire