Author |
Topic |
GauravBhabu
Advanced Member
4288 Posts |
Posted - 03 February 2002 : 14:26:12
|
quote: here's an idea to a really good logging mod G. I was thinking of checking the date and creating new logs for every month of the year which will slim down the size of the log file and conveniently would offer separate files for reviewing by month. my log file is already 5 megs in a matter of 2 weeks.
Yeah I had been thinking that too. That will be easy. you can name the logfile to include monthname and year. So that will keep a file for each month automatically. Will post the changes.
quote: oh yeah, as a side note, I review this log quite frequently andctually found someone trying to get to my admin areas several times which allowed me to eventually ban them by ip.
I too look at contents of this file and is really a usefull log file.
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 03 February 2002 : 14:27:24
|
quote: I also have the same problem I have the latest version of the active users build (I think rewritten by nathan not your build) I have looked in to the log file and I do not see where the user is. I have looked in the inc_top.asp file but I do not have the line
strScriptName = Request.servervariables("script_name")
Let me know if you would like to see any of my files
Then just add this statement immediately before the code for the log file.
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Kong
Junior Member
100 Posts |
Posted - 03 February 2002 : 16:18:02
|
Add it where?
I (and I think SimonT) have Active Users Mod 3.5 installed and don't see that line anywhere inc_top.asp. You say to add it with the rest of the coding but I'm assuming you mean with the rest of the coding for the inc_top.asp.
I have active users intalled and wanted to use the other coding. Should I just add that line in the inc_top.asp anyway?
_________________________ Come on by and visit Deth Incarnate. Growing slowly, but growing none the less. |
|
|
SimonT
Junior Member
United Kingdom
202 Posts |
Posted - 03 February 2002 : 17:11:04
|
'Log file settings strScriptName = Request.servervariables("script_name") dim iplg, logFile8 set iplg=server.createObject("scripting.FileSystemObject") ...
is there any way that when the page is logged it can show the full page eg post.asp?method=Reply&TOPIC_ID=1910.. not just post.asp ? |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 03 February 2002 : 17:26:25
|
quote:
Add it where?
I have active users intalled and wanted to use the other coding. Should I just add that line in the inc_top.asp anyway?
Just add that one line above the script which is mentioned under Active users Mod Installed
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Kong
Junior Member
100 Posts |
Posted - 03 February 2002 : 18:31:36
|
K maybe it's just me but I'm having a hard time figuring out what is going on in this thread.
I have Active Users v3.5 installed, I do not have the line strScriptName = Request.servervariables("script_name") in my inc_top.asp.
I have put the following lines (as instructed above) in to my inc_activeusers.asp
dim iplg, logFile8 set iplg=server.createObject("scripting.FileSystemObject") set logFile8=iplg.openTextFile(server.mappath("/forum/FOLDERNAME/IPLOG.txt"),8) logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & CHR(9) & strOnlineUser & vbCrLf logFile8.close set logFile8=nothing set iplg=nothing
It all seems to work. It shows me the date and time, userip and username. However, it does not show me where they visited.
Now, my questions are as follows...
The line - strScriptName = Request.servervariables("script_name") - which is supposed to be in the inc_top.asp, what does it do? Is it needed if you have Acive Users Mod installed? If yes, where does it belong?
Also, Do you know why it isn't showing me what pages people are viewing?
I'm sorry if this is getting repeatative but I need to know and so far I don't have a clue... I'm having a hard time understanding what questions the answers which have been given belong to.
_________________________ Come on by and visit Deth Incarnate. Growing slowly, but growing none the less.
Edited by - Kong on 03 February 2002 18:35:17 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 03 February 2002 : 19:23:36
|
May be this statement is not in v3.5. Just add it as shown and you will be all set.
strScriptName = Request.servervariables("script_name") dim iplg, logFile8 set iplg=server.createObject("scripting.FileSystemObject") set logFile8=iplg.openTextFile(server.mappath("/forum/FOLDERNAME/IPLOG.txt"),8) logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & CHR(9) & strOnlineUser & vbCrLf logFile8.close set logFile8=nothing set iplg=nothing
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Kong
Junior Member
100 Posts |
Posted - 03 February 2002 : 20:21:22
|
Excellent. Thanks for clearing that up for me.
I have only one more questions.
Now that it is showing where they are viewing, is there a way to dispaly the Name of the page and not the URl. eg Topic: I have a headache.
The same way it displays it in the active users area.
_________________________ Come on by and visit Deth Incarnate. Growing slowly, but growing none the less. |
|
|
klombardi
Starting Member
4 Posts |
Posted - 06 February 2002 : 22:59:19
|
ok,
I have Active Users Mod 3.5, and the following lines do not appear anywhere in inc_activeusers.asp.
'CHECK IF USER NAME AND IP ADDRESS MATCH set rsWho = Server.CreateObject("ADODB.Recordset")
Was this code removed as part of a newer version of the Active Users Mod. I did a search for that code through all the Snitz Forum code that was on my server, and it didn't appear anywhere. We are using Version 3.3.03 on our server. Any chance you could tell me where to put the User Log code with the newer versions?
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 06 February 2002 : 23:23:54
|
It is around Line 160 in inc_activeusers.asp
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Kong
Junior Member
100 Posts |
|
klombardi
Starting Member
4 Posts |
Posted - 07 February 2002 : 11:53:15
|
Rakesh, I put the code in around Line 160, works like a charm, thanks :)
To the other people trying to find out how to add the code in that shows what page the user is viewing, you can change the following code to get that information into your logs. If you are using Active Topics 3.5, go into inc_activeusers.asp and change strScriptName to strOnlineLocation in the following line and you will see the page accessed and not just the script name. I did it in mine and it's works very nicely.
logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & CHR(9) & strOnlineUser & vbCrLf
Thanks again Rakesh for this great code, it's going to help out a lot.
- Kevin Lombardi
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 07 February 2002 : 12:26:22
|
quote:
Would it be possible to set it up so that it displays the full url?
eg. http://forum.snitz.com/forum/topic.asp?TOPIC_ID=19108 and not just http://forum.snitz.com/forum/topic.asp
Add the text in red as shown
logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & "?" & Request.querystring & CHR(9) & strOnlineUser & vbCrLf
if you have active users Mod installed then use this
logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strOnlineLocation & CHR(9) & strOnlineUser & vbCrLf
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Edited by - GauravBhabu on 07 February 2002 12:31:26
Edited by - GauravBhabu on 07 February 2002 16:30:34 |
|
|
Kong
Junior Member
100 Posts |
Posted - 07 February 2002 : 16:00:55
|
quote:
if you have active users Mod installed then use this
logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & OnlineLocation & CHR(9) & strOnlineUser & vbCrLf
In order for me to get it to work I had to add str before OnlineLocation like so:
logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strOnlineLocation & CHR(9) & strOnlineUser & vbCrLf
It wasn't working without it. The only weird thing about it is that it adds hyperlink coding to the text but since it's a text file it displays the code.
Like so... 20020207153446 209.91.129.184 Kong <a href="default.asp">Forums</a>
To View it I wrote a small ASP file which displays the TXT file and it works that way.
Thanks for helping me out.
_________________________ Come on by and visit Deth Incarnate. Growing slowly, but growing none the less. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 07 February 2002 : 16:31:30
|
Okay use this, then
logFile8.write strOnlineCheckInTime & Chr(9) & strOnlineUserIP & CHR(9) & strScriptName & "?" & Request.querystring & CHR(9) & strOnlineUser & vbCrLf
www.forumSquare.com - GauravBhabu - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Topic |
|