PHP Classes

Simple class for logs: Log entries to files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  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 (4 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 385 All time: 6,206 This week: 1,111Up
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.

Picture of Stanislav Afanasiev
  Performance   Level  
Name: Stanislav Afanasiev is available for providing paid consulting. Contact Stanislav Afanasiev .
Classes: 2 packages by
Country: Russian Federation Russian Federation
Age: 27
All time rank: 130841 in Russian Federation Russian Federation
Week rank: 360 Up15 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  
 0%Total:385All time:6,206
 This week:0This week:1,111Up