PHP Classes

Simple class for logs: Log entries to files

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 392 All time: 6,641 This week: 571Up
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 <contact>
Classes: 2 packages by
Country: Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 1x

Details

/** * 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 (3)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:392
This week:0
All time:6,641
This week:571Up