PHP Classes

Simple class for logs: Log entries to files

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2011-03-01 (8 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 390 All time: 6,520 This week: 478Up
Version License PHP version Categories
simple-class-for-log 1.0GNU General Publi...5.0PHP 5, Logging
Description Author

This class can log entries to files.

It can append log entry messages to given log files.

The log entries can include the current timestamp and the current script memory usage.

  Performance   Level  
Name: Stanislav Afanasiev is available for providing paid consulting. Contact Stanislav Afanasiev .
Classes: 2 packages by
Country: Russian Federation Russian Federation
Age: 31
All time rank: 119539 in Russian Federation Russian Federation
Week rank: 105 Up6 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 1x


 * Simple class for logs
 * @description: Example use

 // include class
 require_once 'Logger.class.php';
 // create object of logger class
 // write in log.txt
 // log file be overwritten
 $obLog = new Logger('log.txt');
 // or
 // log file be NOT overwritten
 $obLog = new Logger('log.txt','r+');
 // log write
 // simple use
 // log write be date and memory use by default ( separator \n)
 $obLog->LogIt('Start script');
 // without memory use
 $obLog->LogIt('Start script',true,"\n","a+",false);
 // with r+ mode
  $obLog->LogIt('Start script',true,"\n","r+");
  // write in html file
  $obLog = new Logger('log.html');
  $obLog->LogIt('Start script',true,"<br>");
  Files folder image Files  
File Role Description
Accessible without login Plain text file Example.php Example Example use
Plain text file Logger.class.php Class Logger class
Accessible without login Plain text file README Doc. README

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,520
This week:478Up