#!/usr/bin/php -q "._('Error').""._('Warning').""._('System').""._('Array').""._('Login')."

\n"; $handle = popen('/usr/bin/tail -n 40 -f '.escapeshellarg("/var/log/{$argv[1]}").' 2>&1', 'r'); while (!feof($handle)) { $line = fgets($handle); if (strpos($line,'tail_log')!==false) continue; $span = "span"; foreach ($match as $type) foreach ($type['text'] as $text) if (preg_match("/$text/i",$line)) {$span = "span class='{$type['class']}'"; break 2;} echo "<$span>".htmlspecialchars($line).""; flush(); } pclose($handle); ?>