Sure, this is just a little thing, but i liked to show the apaches long lined access.log in a better readable way.
Just opening the access.log file with PHP and parsing line per line….
$file = "/path/to/access_log";
@$fp = fopen($file,"r");
if (!$fp) {
echo $file ."not existent!\n";
}
else {
while (!feof($fp)) {
$zeile = fgets($fp, 230);
$buffer = explode(" ", $zeile);
$datum = substr($buffer[3], 1);
echo "IP-Address: ".$buffer[0]."\n";
echo "Date: ".$datum."\n";
echo "DeliveredPage: ".$buffer[6]."\n";
echo "Backlink: ".$buffer[10]."\n";
echo "User-Agent: ".$buffer[11]."\n";
echo "
\n";
}
}
@fclose($fp);