开发者

Where to put logging in an MVC application

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜