Index

Version 15 (Simone Carletti, 08/26/2008 04:20 pm)

1 1
h1. Apache Log Analyzer 2 Feed
2 1
3 1
<img src="http://www.simonecarletti.com/static/images/logo/apachelog2feed.png" align="left" />
4 3 Simone Carletti
ApacheLogAnalyzer2Feed is a really powerful open source PHP 5 class to parse and analyze Apache Web Server log files.
5 15 Simone Carletti
Analysis results are converted into a feed to let users subscribe them with a feed reader.
6 1
7 1
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.
8 1
The class can easily be extended with additional filters and custom feed handlers.
9 1
10 1
h2. A quick example
11 1
12 1
Would you like to be informed each time GoogleBot visits your website?
13 1
14 7 Simone Carletti
ApacheLogAnalyzer2Feed is the solution! ApacheLogAnalyzer2Feed will analyze server logs for you returning results in a custom feed. 
15 7 Simone Carletti
Simply using the following code fragment you'll be able to track Googlebot directly from your feed reader.
16 4 Simone Carletti
17 4 Simone Carletti
<pre><code class="php">
18 4 Simone Carletti
/**
19 4 Simone Carletti
 * @see ApacheLogAnalyzer2Feed
20 4 Simone Carletti
 */
21 4 Simone Carletti
require_once 'ApacheLogAnalyzer2Feed.php';
22 4 Simone Carletti
23 4 Simone Carletti
// Create an instance. 
24 4 Simone Carletti
// Tell the script to parse access.log file and write the results in test.xml.
25 4 Simone Carletti
$tool = new ApacheLogAnalyzer2Feed('access.log', 'test.xml');
26 4 Simone Carletti
27 4 Simone Carletti
// Add a filter to retrieve only log entries matching Googlebot useragent
28 4 Simone Carletti
$tool->addFilter('User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
29 4 Simone Carletti
30 4 Simone Carletti
// Run the tool!
31 4 Simone Carletti
$tool->run();
32 8 Simone Carletti
</code></pre>
33 1
34 12 Simone Carletti
h2. Documentation and Resources
35 8 Simone Carletti
36 13 Simone Carletti
* "Downloads":/projects/list_files/apachelog2feed
37 9 Simone Carletti
* [[Installation]]
38 14 Simone Carletti
* [[Examples|Example usages]]
39 1
* [[Acknowledgments]]
40 12 Simone Carletti
* [[License]]
41 1
42 1
h2. About this library
43 1
44 1
<img src="http://www.simonecarletti.com/blog/public/2007/05/anteprima-ses-2007/ses.png" align="right" />
45 1
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.
46 1
47 1
I created this project as a technical example for my speech at Search Engine Strategies 2007 in Milano, session RSS, Blogs & Search Marketing.
48 1
My goal was to demonstrate an alternative use of feeds, showing how RSS and Atom feeds can make SEO life easier.