Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 5 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();
}
?>