Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ServiceStack response filter "short circuiting" causing problems

Tags:

servicestack

We have embraced SS as our REST server platform and love it - one of the recurring issues I face deals with logging requests that have been "short circuited" for one legitimate reason or another (errors, missing mandatory headers, etc).

I am finding that I have to add extra logging code to many different code exit (ie short circuited) points because I still want to capture the request in the logs. Am I doing something wrong here? is there a way to specify a "mandatory response filter" that occurs even after short circuiting. I could see multiple uses for this beyond just logging...

Thanks in advance,

Jordan

like image 487
jglassco Avatar asked Jul 31 '26 04:07

jglassco


1 Answers

You can override the AppHost.OnEndRequest() which gets called at the end of each request.

like image 178
mythz Avatar answered Aug 01 '26 18:08

mythz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!