Pimp my website log - Kore Nordmann - PHP / Projects / Politics

Kore Nordmann - PHP / Projects / Politics

By Kore Nordmann, first published at Wed, 01 Mar 2006 15:17:00 +0100

Pimp my website log

There are several free website log analyser out there, like AWStats , Analog , Webalizer or Visitors , but all of them have in common to generate quite ugly statistics. For this website I decided to use Visitors, because it is very easy to handle, fast and small. It can generate some interesting statistics like web trails and combined maps , which shows brighter fields for more hits on a 2D map.

But the use of html for generating graphs for sure is the wrong way. We can use SVG now (ok, the users of an uptodate gecko engine can), and this results in smaller and scaleable graphs.

I started hacking around two days ago and got finished with quite impressive first results (you need Mozilla Firefox 1.5 to display the SVG graphs properly) yesterday. It took me some time to find out how to draw ellipse sectors - the RFC is not very intuitive at this point. Finished with this, everything else was more or less trivial. Now you type something like this and you'll get some really beautiful SVG's:

# visitors -G -K -U -W -M -O -B -X -Y -R -o text --trails \ # --prefix http://example.com /path/to/access.log \ # | /path/to/visitors_svg/genstat.php -t /path/to/visitors_svg \ # -c /path/to/visitors_svg /path/to/report_directory

You can obtain the source of the script here . But be warned:

  • It is not really tested for now - I just played around a little bit, and it works fine for me :-)

  • Do not think the code for the generation of the graphs is really reuseable ;-)

If you liked this blog post, or learned something please consider using flattr to contribute back: .

Comments

Add new comment

Fields with bold names are mandatory.

eZ Components

eZ Components

Exploring PHP

Exploring PHP

Hire me

Amazon wishlist

Powered by