homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Mini Web Log Analyzer?

 4:11 pm on Nov 25, 2003 (gmt 0)


I'm trying to do a tiny code that gets an IP "route" through our site. Like, gets an IP from a field, opens a log file into an array, compares the IP and creates a new array with only the matches(composed only of .htm or .php files), and prints it. Thing is, I'm having some issues with the code(with all the code, lol), mostly with the "open log" part. Our logs are very big(7k visits daily) and it takes a LOT of time to even open it in the first place. Isn't there a way to open it in "pieces"? (like, 20MB at a time) or do I need to manually split the log file? Do you know an already finished script that does this?

Thanks in advance!



 4:46 pm on Nov 25, 2003 (gmt 0)


I'd advise you to look into logging to a database for this kind of thing. Or, take a look at PhpOpenTracker (www.phpopentracker.de), an excellent Open Source project that will do exactly what you are after and a lot more.


 5:51 pm on Nov 25, 2003 (gmt 0)

opening it with fopen shouldn't be an issue. The real problem with log parsers is the sheer volume of data you need to read through and compare.

I have one and it runs in seperate parts. I run a clean up script first which dumps a fair amount of data and stores the rest into another file. I then do all of the comparisons/searches/counts on that. It saved a lot of processing time.

You could have apache rotate the logs more often so that it gives you smaller pieces to deal with.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved