PHP Classes

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    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 162 All time: 8,939 This week: 488Up
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.

Picture of Alex Lushpai
  Performance   Level  
Name: Alex Lushpai is available for providing paid consulting. Contact Alex Lushpai .
Classes: 4 packages by
Country: Russian Federation Russian Federation
Age: 39
All time rank: 276277 in Russian Federation Russian Federation
Week rank: 170 Up7 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 2x

Documentation

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:162
This week:0
All time:8,939
This week:488Up