Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 380721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:00:59+00:00 2026-05-12T15:00:59+00:00

I would like to keep a log of each page view for all users

  • 0

I would like to keep a log of each page view for all users of my web application. After enough time has passed, I will then use that log to generate reports. I would like to have the logging mechanism be a bit flexible since I wouldn’t need to log every http request.

An example use case is: A company signs up for my web app and allows 5 employees to use the application. I would like to report that 3 employees used the application in the last week. Or show that 4 employees used it between June and August of the current year.

I’m using asp.net mvc with sql server, if that makes a difference.

Is it just as simple as this? Create a sql table with the following columns: UserId, ControllerName, ActionName, ActionParameters, CreatedOn. Then create an ActionFilterAttribute that adds a record to the db for each action invoked.

Are there any pitfalls that I should worry about (other than a potentially large table size)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:00:59+00:00Added an answer on May 12, 2026 at 3:00 pm

    Some of the pitfalls:

    1. You will not be able to do any server level page caching.
    2. Lots of db writes since you are in effect logging each request.
    3. If there are any actions that happen on pages you could be storing redunant information.

    I would assume you would implement this in some type of custom AuthorizeAttribute so your not coding it on every controller but then it will be literally every request which would possibly be more than you actually need.

    Have you considered using some type of IIS log parsing utility? It would have a lot of the info you need already.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to keep a log of all searches that users do on my
I would like to keep model binding when doing ajax calls from my view.
I need to do logging in our application and would like to keep the
I need to create application log file using Linq-To-Xml. I would like to lock
I would like to keep the overhead at a minimum. Right now I have:
I would like to keep a static counter in a garbage collected class and
I would like to keep a list of a certain class of objects in
I would like to keep an item selected, on a ListView, when the user
I currently have a controller were I would like to keep track of logging
I have a small JSF app and would like to keep some state on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.