Login   Register  
PHP Classes
elePHPant
Icontem

File: viewlog.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bram Gerritsen  >  PEAR Log Parser  >  viewlog.php  >  Download  
File: viewlog.php
Role: Example script
Content type: text/plain
Description: Example with priority filter
Class: PEAR Log Parser
Parser for files generated by PEAR log package
Author: By
Last change:
Date: 10 years ago
Size: 734 bytes
 

Contents

Class file image Download
<?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();

?>