It should be a straight forward and simple answe开发者_C百科r, but I'm trying to figure out where to put the logging into my MVC application. Is it wise to put it in the Controller or the Model?
Try this SO question:
Logging errors in ASP.NET MVC
Hope that helps
Your logging should be in the Controller since that is where the processing of logic should take place.
The Model is for storing data.
Use custom action filters to handle logging.
take a look at the following article for info >> http://www.asp.net/mvc/tutorials/understanding-action-filters-cs
精彩评论