ASP.NET MVC: Access Logs

On an ASP.NET MVC website, what's the best way to implement access registration? I want to answer the following questions:

  • What are the most popular pages?
  • Which pages have accessed the past 24 hours?
  • and etc.

I could connect to the server using Remote Desktop and filter through IIS logs myself (even using Microsoft Logfile Parser), but I would like to be able to run reports from the admin pages of my site.

What is the best way to do this? Should I:

  • Add trace to all my controller methods?
  • Add an IHttpFilter file (or something else) and register?
  • Configure IIS (IIS7 in Windows 2008) to log into a table in my database, and then determine the NHibernate mapping for this table?
  • Something else?
+4
source share
4 answers

Sebastian's answer, of course, is not bad (voted), however, he reimplementes the functionality already available in IIS. IIS logging is likely to work better than something home-made. (For example, it will record material that does not go through the MVC stack.) For this reason, I would like to use something in the lines of your option 3.

0
source

Why not just use [Google Analytics]? ( http://www.google.com/analytics/ ). In my opinion, a much simpler way to get these statistics. In addition, you will receive rich information about bonuses. Not to mention that you have access to it anywhere in the world.

0
source

I control logging exclusively on the server side. To perform cache counting, etc. You need some kind of client code. That's why all modern web analytics (like Google Analytics and much more) have a client piece ... of code too.

The output cache can also be painful when logging, unless you insert an HttpModule in front of the output cache module, etc.

0
source

All Articles