Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2005
    Location
    greater manchester, uk
    Posts
    65
    Thanks
    3
    Thanked 0 Times in 0 Posts

    logging visitors' details to a flat file

    hello!

    i'm using .asp and want to log users' visitation details (times, dates, etc) to a flat file located on my web-server.

    i know that i could do this simply by creating a file system object through .asp, but is this necessarily the best way to go about it?

    i'm thinking that there will probably be file locking issues associated with logging the details of every visitor in the same file, and so would i be better off using some sort of cgi script (yeah, i know there's a seperate forum ;-) )?

    ideally, i'd like the file writing process to run independently of the .asp code, so that the user wouldn't be left waiting to receive their web page while the 'logging' file was being written by another user.


    i realise that i might be approaching this from completely the wrong angle, but if anyone knows of the best way to acheive my goal then I'd grateful if you could help me out.


    thanks!

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Scripting.FileSystemObject is the best way to go about this, if you are hating life... =)

    Have you thought looking into the IIS logging? IIS keeps track of all of this stuff for you already (and can keep track of a lot more).

    Just go into IIS.mmc > Right-Click your site > Properties.

    Enable Logging is checked by Default. Go into Properties here and you can change your logging schedule. If you go into Advanced, you can track things like Date and Time of visitor, Client IP, Username (if available), and a whole bunch more.

    So now that you have it, how do you mine the data?

    Here are a couple of log parsers that you can use:

    My Favorite (but requires .NET 2.0 framework)
    http://www.softpedia.com/get/Interne...Analyser.shtml

    or

    http://www.topshareware.com/IIS-Log-...load-47739.htm

    or

    one of the other xxx's of share/free wares out there.

    HTH!

  • #3
    New Coder
    Join Date
    Mar 2005
    Location
    greater manchester, uk
    Posts
    65
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Thanks!

    Cool!

    Thanks, daemonspyre!

  • #4
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    As far as I know you don't get locking issues if you only use ASP anyway (could be wrong, but no matter how heavy my asp pages get I have never once had a lock issue, I think it might just queue up to use it in the app pool or something)

    The IIS logs can be pretty good anyway (if you can find them on the server for your particular site and of course if it is your server so you have access to them) and aren't hard to parse manually.

    If you didn't want to do this, you could just print out Request.ServerVariables to a line of the text file, attached to the date. This is pretty simple (expect it to get large quickly if you have a heavy site and you print out every servervariable) and I wouldn't expect any locking issues.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •