PHP Classes
elePHPant
Icontem

Easy log class: Output or write log messages to files

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-04-17 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 265 All time: 7,516 This week: 291Up
Version License PHP version Categories
easy-log-class 1.0GNU General Publi...5PHP 5, Logging
Description Author

This class can output or write log messages to files

It will take a log message and stores in a given log file that defaults to log.txt file under the log directory. The class may prepend the current date to the log file name.

The log messages may be outputted also to the current page.

  Performance   Level  
Name: Ashok kumar kashyap <contact>
Classes: 4 packages by
Country: India India

Details
    This class is create or maintain the log file for your application,
    where you will create any log message for your application and store in log.txt file under the log directory,
    you also create the date wise log file with custom name .
    // create logs folder under the root folder


// create a object for log  class and pass file name parameter as log filename log.txt  and log.txt file create under the logs directory
$log=  new Log();

// if pass the second parameter as true, then it create log file as datewise like 17-4-2016__log.txt
//$log=  new Log('log.txt',true);
$log->write(__FILE__.' this is the file name where the log class was used '); // write any log message

$log->write(' DIR_PATH '.DIR_PATH); // write any log message
$log->write(' DIR_LOGS'.DIR_LOGS); // write any log message



  Files folder image Files  
File Role Description
Plain text file log.php Class Class source
Plain text file read-me.txt Doc. Documentation
Plain text file README.md Data Auxiliary data
Plain text file test.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:265
This week:0
All time:7,516
This week:291Up