PHP Classes
elePHPant
Icontem

PHP Log and Rotate: Write messages to log files that can be rotated

Recommend this page to a friend!
  Info   View files Documentation   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2015-08-05 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 127 This week: 2All time: 8,455 This week: 442Up
Version License PHP version Categories
logger-light 1.0MIT/X Consortium ...5.2PHP 5, Files and Folders, Logging
Description Author

This class can write messages to log files that can be rotated.

It can write messages to log files by creating the log file from the scratch or appending the new messages to the end of the file.

If a log file exceeds a given limit the class can rotate the log files by moving the old log file to another with a new name based on the current date and time.

The class can keep up to a given limit of log files in the logs directory, so older log files are deleted when the limit of log files is reached.

  Performance   Level  
Name: Alex Lushpai <contact>
Classes: 4 packages by
Country: Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 2x

Details

LoggerLight

Simple class that allows you manipulate your applications logs. It can write/rewrite log files, rotate them and send data to email. Rotation enabled by default. Can be used for keep compability with php 5.2

Example

$logger = new LoggerLight();
$logger->write('This is Log Message', '/var/www/application/logs/info.log');
$logger->rewrite(date('Y-m-d H:i:s'), '/var/www/application/logs/lastrun.log');

$logger = new LoggerLight($push = true); // enable send data via email
$logger->write('This is Alert Message', '/var/www/application/logs/error.log');
  Files folder image Files  
File Role Description
Plain text file LoggerLight.php Class Independent logger class
Plain text file Readme.md Doc. Readme file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:127
This week:2
All time:8,455
This week:442Up