Hemanth's Scribes

web

Log file viewer in PHP

Author Photo

Hemanth HM

Thumbnail

= 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

#javascript#linux
Author Photo

About Hemanth HM

Hemanth HM is a Sr. Machine Learning Manager at PayPal, Google Developer Expert, TC39 delegate, FOSS advocate, and community leader with a passion for programming, AI, and open-source contributions.