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 Hatem Mohamed  >  Log class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Log class
Write log messages to files
Author: By
Last change:
Date: 2010-05-17 07:27
Size: 607 bytes
 

Contents

Class file image Download
<?php
/*

============================================
FileName    : example.php
Author        : Hatem Mohamed (http://www.itmideast.com)
Mail        : developer-php@hotmail.com
Country        : Egypt
Class Name    : Log Class
Date        : May 2010
============================================
 */



try
{
    
/*** a new logger instance ***/
    
$log logger::getInstance();
    
/*** the file to write to ***/
    
$log->logfile '/tmp/errors.log';
    
/*** write an error message with filename and line number ***/
    
$log->write('An error has occured'__FILE____LINE__);
}
catch(
Exception $e)
{
    echo 
$e->getMessage();
}

?>