« Previous -
Version 12/25
(diff) -
Next » -
Current version
Simone Carletti, 08/26/2008 03:13 pm
added link to license
Apache Log Analyzer 2 Feed¶
<img src="http://www.simonecarletti.com/static/images/logo/apachelog2feed.png" align="left" />
ApacheLogAnalyzer2Feed is a really powerful open source PHP 5 class to parse and analyze Apache Web Server log files.
Analysis results are converted into a feed to let users subscribe with a feed reader.
You can define custom filters based on logs data — for instance User-Agent, IP, requested page... — and combine them to select just a limited resultset.
The class can easily be extended with additional filters and custom feed handlers.
A quick example¶
Would you like to be informed each time GoogleBot visits your website?
ApacheLogAnalyzer2Feed is the solution! ApacheLogAnalyzer2Feed will analyze server logs for you returning results in a custom feed.
Simply using the following code fragment you'll be able to track Googlebot directly from your feed reader.
1 /**
2 * @see ApacheLogAnalyzer2Feed
3 */
4 require_once 'ApacheLogAnalyzer2Feed.php';
5
6 // Create an instance.
7 // Tell the script to parse access.log file and write the results in test.xml.
8 $tool = new ApacheLogAnalyzer2Feed('access.log', 'test.xml');
9
10 // Add a filter to retrieve only log entries matching Googlebot useragent
11 $tool->addFilter('User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
12
13 // Run the tool!
14 $tool->run();
Documentation and Resources¶
About this library¶
<img src="http://www.simonecarletti.com/blog/public/2007/05/anteprima-ses-2007/ses.png" align="right" />
ApacheLogAnalyzer2Feed is an easy-to-use object oriented class, written in PHP 5, for parsing/filtering an Apache log file and consuming the results with a feed reader.
I created this project as a technical example for my speech at Search Engine Strategies 2007 in Milano, session RSS, Blogs & Search Marketing.
My goal was to demonstrate an alternative use of feeds, showing how RSS and Atom feeds can make SEO life easier.