minecraftd/utils.php
// get last n lines in log
get last n lines in log
get last n lines in log
function tail_log($n) {
	$log = "/srv/minecraft/logs/latest.log";
	$output = shell_exec("tail -n $n $log");
	$tag = "p";
	return "<$tag>" . str_replace("\n", "</$tag><$tag>", $output) . "</$tag>";
}
function tail_log ( $ n ) { $ log = " /srv/minecraft/logs/latest.log " ; $ output = shell_exec ( " tail -n  $ n $ log " ) ; $ tag = " p " ; return " < $ tag > " . str_replace ( " \n " , " </ $ tag >< $ tag > " , $ output ) . " </ $ tag > " ; }
get last n lines in log
get last n lines in log