PHP Classes

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    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 269 All time: 7,643 This week: 261Up
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.

Picture of Ashok kumar  kashyap
  Performance   Level  
Name: Ashok kumar kashyap <contact>
Classes: 4 packages by
Country: India India
Age: 35
All time rank: 2047127 in India India
Week rank: 588 Up42 in India India Up

    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 Data Auxiliary data
Plain text file test.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,643
This week:261Up
For more information send a message to info at phpclasses dot org.