Hello mates,
I've been studying about logging and exceptions handlers and I found two different approaches:
1) Create a ActionFilter to handle the exceptions and log the messages to a file for example.
You can read more about it here
- http://ludwigstuyck.wordpress.com/2009/06/15/asp-net-mvc-quickstart-7-action-filters/
- http://www.dimecasts.net/Casts/CastDetails/37
2) Using the Global.asax (on error) to log the errors. You can find more info here:
- http://www.asp.net/LEARN/mvc-videos/video-430.aspx
The question is which one is the best approach? I like the ActionFilters because I might have more control. Also I was thinking about putting both approaches together (using ActionFilters with the NLog.net).
What do you recommend guys?
Thanks for that.
G