Server Log File Search PHP Script

SearchLog© is a simple PHP script that looks for information in Apache server logs. It is designed to let webmasters and website designers find information about how their site is being used. It can locate the activities of human or automated users and give you lots of useful information. It allows you to do three kinds of searches: a general search, a search for search engine robots, and a search for traffic from the search engines. If you do your own search engine optimization, this is a very handy program.


SearchLog v2.0 is an overhaul of my original script which was written in Perl. The new v2.0 is written in PHP and includes the basic search function, allowing you to look in specific fields such as IP Address, the HTTP Request, the Referer, etc., or in all fields, for any value. This search is case-insensitive. I like to use this function to track down server errors by entering "404" or "500" in the search box and searching on the Result field. This is very useful for spotting where errors are coming from on your website, and also for detecting automated accesses, such as hacking attempts.

The second search looks for requests from search engine robots. You can select any of several crawlers for Google, Bing, Yahoo!, and Ask. This search lets you know which files have been crawled, when, and by which crawler - including the image and media crawlers like the AdSense© bot. While services like Google's Webmaster Tools can tell you a lot about their robots' activities on your site, this program allows you to see exactly which files have been crawled. It highlights server errors and redirects so that you can spot them easily in the results.

The third search looks for user traffic from the search engines and tells you the search terms the user entered when he clicked on your site in the search engine results page. Again, you can select which search engine to use for this function, and you'll see the exact search phrases used, and not just a summary report like the ones in Google's Webmaster Tools.

SearchLog© requires that your site run on an Apache-based server and that you have access to your access log files. See the "readme.txt" file included in the download package for complete installation instructions and documentation. Installing the PHP script requires only editing the User Settings file and then uploading two files to your server.

SearchLog© is provided free of charge. If you use and appreciate it, please post the following link in an appropriate location on your site:

a href="https://www.rainbodesign.com/pub/" Rainbo Design Tools & Scripts/a



If you like SearchLog©, be sure to check out Spider Tracks©, a powerful script that lets you track the activities of search engine robots and search engine users on your website!

This page was last modified on August 27, 2020



Copyright © 2005-2024 by Richard L. Trethewey - Rainbo Design Minneapolis. It's not that I think this is such an earth-shatteringly great presentation, but if you want to copy it, I'd appreciate it if you would ask for permission. I've been working with computers for over 30 years now, and one phrase keeps popping into my head - "I hate it when it's right!" And laptops and smartphones are no better.

Looking for more website design information? See my Sitemap!