Best place to hook incoming requests

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 …

thank you
enrico sabbadin

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 ?

thank you

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.

I’m interested is doing some logging in the first hook that is shared by http and no http based hosts.
which one should I choose ?
thank you
enrico

Use a PreRequestFilter.