PHP Classes
elePHPant
Icontem

DLog: Simple logging class.

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2003-04-29 (12 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,719 All time: 2,145 This week: 1,489Up
Version License Categories  
dlog 1.0GNU Lesser Genera...Logging
Description Author  

Simple logging class that allows to log the events calling the class directly or as an error handler. For each error type, you may specify how to log the information.

The class may:

- Send an e-mail
- Write to a log file
- Record in a database (MySQL or MSSQL are supported, but you can extend the class to support other databases)
- Display the error or the message
- Do nothing. You may set the class to take no action in a specific situation.

Picture of Andrioli Darvin
Name: Andrioli Darvin <contact>
Classes: 5 packages by
Country: Italy Italy
Age: 47
All time rank: 934 in Italy Italy
Week rank: 261 Down10 in Italy Italy Down

Details provided by the author  
DLog version 1.0

Description:
----------------------
Simple logging class. It allow to log the event calling it directly or as
an error handler. For each error type, you may specify how to log the information.

The class may:
- send an e-mail
- write a logging file
- register into database (Mysql or MSSql supported, but you may want to extend the
  class to support other database)
- display the error or the message
- do nothing... you may set to take no action in some situation.

Installation:
----------------------
PHP => 4.3.0 - I've test the class using PHP 4.3.0 and PHP 4.3.1.
               I think the class should work with PHP 4.2.x, except
               the function 'register_error_handler';
Configure the [mail function] section in php.ini if you plan to send the e-mail
If you plan to log the event into some database, define a table as follow
(example taken from Mysql):

CREATE TABLE dlog (
  id int(10) unsigned NOT NULL auto_increment,
  DEvent varchar(14) DEFAULT '0' ,
  Errno int(3) DEFAULT '0' ,
  Text varchar(250) DEFAULT '0' ,
  FileName varchar(250) DEFAULT '0' ,
  Line int(3) DEFAULT '0' ,
  RemAddr varchar(20) NOT NULL DEFAULT '' ,
  Browser varchar(100) NOT NULL DEFAULT '' ,
  PRIMARY KEY (id)
);

That's all. I hope it be useful.
Darvin
(darvina at libero dot it)
  Files folder image Files  
File Role Description
Plain text file dlog.php Class Main class source
Plain text file dlog_cfg.inc Conf. Class configuration
Plain text file dlog_mssql.php Class MSSQL extensions
Plain text file dlog_test.php Example Example of use
Plain text file dlog_test2.php Example Another example
Accessible without login Plain text file readme.txt Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,719All time:2,145
 This week:0This week:1,489Up