Hi … i’m currently using this.GlobalRequestFilters.Add to log all incoming requests …
however if I use GlobalRequestFilters i can log only calls that have been corrrectly routed and binded
Is there a way to hook the message processing up in the stack , that is before routing and binding … so that i can be called even if they fail ?
Curently i am using globalasax.beginrequest , but i’m not very happy about that
I can see app.host.onafterexecute, onendrequest … but nothing such as apphost.beforeexecute …
You can check the Order of Operations for the list and sequence of different hooks available, e.g. you could register a PreRequestFilter which happens before a request is binded.
that’s what i was looking for …
just one note :
why there is a IServiceRunner.OnBeforeExecute, aand IServiceRunner.OnAfterExecute
while ServiceStackHost has got a OnAfterExecute only ?
Hooks are added as they’re needed. The AppHost does have an OnPreExecuteServiceFilter() and corresponding OnPostExecuteServiceFilter() which are more appropriately named as they allow you to change the request and response DTO’s.