PHP Classes

File: example.php

Recommend this page to a friend!
  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: 14 years ago
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();
}

?>