Log file viewer in PHP

= 0) { $position = $position - $chunklen; if ($position < 0) { $chunklen = abs($position); $position=0;} fseek($fp, $position); $data = fread($fp, $chunklen). $data; if (substr_count($data, "\n") >= $num_to_get + 1) { preg_match("!(.*?\n){".($num_to_get-1)."}$!", $data, $match); return $match[0]; } } fclose($fp); return $data; } function show_log($log){ $data=tail('$log'); $data = explode("\n",$data); while (list($var, $val) = each($data)) { ++$var; $val = trim($val); print "$val
"; } print "
"; } Click on the links to see the logs

Apache-Access-Log
Apache-Error-Log
Clear

Share this