开发者

What request info to log in an ASP.Net MVC application

开发者 https://www.devze.com 2023-02-07 05:08 出处:网络
I\'m not concerned w开发者_开发问答ith logging for defect fixing, but more for google-like analytics.Does anyone have a killer schema that they use to make analytics easier.I\'d prefer to have control

I'm not concerned w开发者_开发问答ith logging for defect fixing, but more for google-like analytics. Does anyone have a killer schema that they use to make analytics easier. I'd prefer to have control over the analytics on my site and am looking for good practices/ideas/implementations.


I would first look at the properties available in the current HttpRequest class such as:

  • HttpMethod
  • Path
  • PathInfo
  • QueryString
  • RawUrl
  • UrlReferrer
  • UserAgent

You may also want to record, if applicable:

HttpSessionState.SessionID

You could then log the information you need into a database for every request for later analysis. How you analyse the data depends on what you want to know.

0

精彩评论

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