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
"; } print "
"; } Click on the links to see the logs
Apache-Access-Log
Apache-Error-Log
Clear
Recent blog posts
- watir-webdriver web inspector
- gem list to gemfile
- Packing ruby2.0 on debian.
- Made it into The Guinness Book!
- to_h in ruby 2.0
- Filter elements by pattern jQuery.
- Better HTML password fields for mobile ?
- Grayscale image when user offline
- nth-child CSS pseudo-class Christmas colors
- EventEmitter in nodejs