PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Salil Kothadia   LogParser   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: The example / implementation file
Class: LogParser
Parse Apache log files
Author: By
Last change: Change in description
Date: 15 years ago
Size: 348 bytes
 

Contents

Class file image Download
<?php

include 'LogParser.php';

try
{
   
$Instance = new LogParser('access.log');

   
// get a log line
   
while ($LogString = $Instance->GetLine())
    {
       
$ParsedData = $Instance->Parse($LogString); // parse/format the line

       
echo '<pre>'; print_r($ParsedData); echo '</pre>';
    }
}
catch(
Exception $e)
{
    echo
$e->getMessage();
}
?>