Hello,
On 12/10/2003 08:11 AM, bonfils wrote:
Is there such a thing out there anywhere?
I reckon it should be pretty simple to code a php application that *just*
read the httpd-log(s) from Apache, parsed these and presented simple stats
pages.
Believe, I've spent hours searching the net. But all of the systems I've
found seem to use a database (not neccesarily a bad thing, I suppose,
considering the amount of data).
But what's worse, they always do their *own* tracking (by means of inserted
codes or image tags), which means the stats start from scratch the day you
implement it (and you will have two systems logging a lot of the same info
which doesn't seem very useful).
Before I lose my patience and sit down and code the thing myself (yeah,
right!), do anyone here know of an alternative? The stats can be simple as
hell - just counting page hits by day, perhaps week and month, no more.
You may want to take a look at this class. It is not really a log
analyzer but rather a base for one. What it does is to watch a given log
file.
You can ask it to retrieve the log lines to do your own analysis and
when the log is closed the class stores a sort of bookmark that
indicates the last line of the log that was analyzed.
Next time you run your log analysis script, the class is capable of
picking up where it stopped. This makes the class suitable for tasks
that are based on monitoring logs.
Currently, the class has builtin support to send the newly added log
lines to a given e-mail address. I developed this to be notified about
problems in the server that make the PHP code not work properly so I can
act promptly.
I have more applications for this class in mind like detecting users
causing excessive load in the server by using robots or some other
hacks. So, I will probably add support to parse log lines in common formats.
I think you can use it to make any kind log analisys that you want.
http://www.phpclasses.org/logwatcher
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/