logging website visits, how??

J

Jeff

ASP.NET 2.0

In my webproject I want to implement some kind of functionality which logs
the vistits to the website. I want it to log what pages the user requested,
when he arrived at the website (session_start), when he leave the website
(session_end).. if some exception occur then that should be logged also

I'm thinking about using the health monitoring system for logging
exceptions. For site visits I'm thinking of putting some code in for example
Page_Load event and when the page is opened then a table in the database is
updated.

Is this a good approach?? any suggestions?? anyone got a link to a great
article showing best practice doing this (I've been googling and cannot find
a good article about the subject)??

Jeff
 
M

Mark Fitzpatrick

Jeff,
I'm not sure if you can do what you want on the session_end. Mostly
that's for cleanup and, if I remember correctly from previous experience
with session_end events in IIS and ASP, you're not allowed to create certain
objects such as database connections since you're meant to be destroying
them. Session_End may not give you much info though as it's pretty much not
representative of when the user left as it's fired when there's a 20 minute
inactivity period or the application decides to correct itself.

Have you thought of, instead of trying to capture all of this
information yourself (which will require a performance hit as you have to
output everything to somewhere), of just building some sort of live parser
for your web server logs? IIS already keeps track of all this information,
and does it very efficiently. You could just parse through this data,
perhaps storing it into a db for access later or for performing tasks such
as reverse IP lookups for dns resolution. This would still be a decent task,
but it's only have the problem as you would already have the information
gathering system, you would just need the report viewer for the web logs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top