We are creating MVC3 applications. We are using default editors and model state validation. We need to log application errors, but we prefer to make it by some kind of a global handler. We have a handler for unhandled exceptions, but we also want to log model state errors.
The question is: Where can we attach our logger to log such errors? Can we somehow override ModelState or detect situation when model served to view has model errors?
Global filters will most likely be your best way to go.
More from SO here: asp.net mvc 3 handleerror global filter always shows IIS status 500 page
Or checkout the msdn doc here:
http://msdn.microsoft.com/en-us/library/gg416513(v=vs.98).aspx