Location: PHPKode > scripts > PEAR Log Parser > pear-log-parser/viewlog.php
<?php
include ("class-logparse.php");

//You need to include your path to the PEAR::Log class
//This is needed to generate an select box for selecting priority filters  
//include ("log.php");
                     
echo "<form action=\"".$PHP_SELF."\" method=\"post\">";
echo "<select name=\"prio\" onchange=\"submit()\">";
echo "<option>alles</option>\n";
for ($i=0;$i<8;$i++)
	echo "<option value=\"".$i."\"".((isset($_POST["prio"]))&&($_POST["prio"]==$i)?" selected":"").">".log::priorityToString($i)."</option>\n";
echo "</select>";
echo "</form>";
echo "<br><br>";

$logparse = new LogParse('tmp/testlog.log');
if (isset($_POST["prio"])
	$logparse->addFilter("prio", $_POST["prio"]);
$logparse->Output();

?>
Return current item: PEAR Log Parser