Neil Knight
Neil Knight

Reputation: 48537

Where to put logging in an MVC application

It should be a straight forward and simple answer, 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?

Upvotes: 0

Views: 1257

Answers (2)

Mark
Mark

Reputation: 6081

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

Upvotes: 1

Justin Niessner
Justin Niessner

Reputation: 245389

Your logging should be in the Controller since that is where the processing of logic should take place.

The Model is for storing data.

Upvotes: 1

Related Questions