开发者

Where to put logging in an MVC application

开发者 https://www.devze.com 2023-01-04 14:33 出处:网络
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 th

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

精彩评论

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