PHP Classes

PHPLogger: Log errors to separate files according to severity

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 918 All time: 3,871 This week: 256Up
Version License PHP version Categories
phplogger 1.0Freeware5.0PHP 5, Logging


This class can be used to log application errors.

It can open separate log files to write error log messages depending on the error severity levels.

The class supports error severity levels: debug, info, notice, warning and error.

Error messages of all severity levels are written to the default error log file. Error and warning messages are also written to separate files.

Picture of Gurdeep Singh
Name: Gurdeep Singh <contact>
Classes: 5 packages by
Country: India India
Age: ???
All time rank: 38622 in India India
Week rank: 405 Down27 in India India Down
Innovation award
Innovation award
Nominee: 1x


README I am having more than 6 years of experience in coding. I started my career with PHP and presently I am in Java, J2EE. I have a good proficiency in Web-Services, Struts, Database, PHP, Linux. You can contact me on for any type of help. I am contributing PHP classes to this site. class helped me a lot when I was fresher, so I thanks to PHPClasses and I am contributing to this site. PHPLogger This class is used to log the information in the file. You just need to make the instance of the class and call the write method to log the required information. This class can be helpful to debug the application. This class can also be used with database queries to log the information on queries and log the time taken by the query to execute. You can find this example in my database related class. I provided the wrapper to the database class. This means that you need not have to open the connection, select the datrabase, and call other mysql function everytime. You can also define the severity of message as DEBUG, INFO, NOTICE, WARNING, ERROR. These severity will added to Log file. This makes easy to read logs. The logs are created with date and time with message. Usage example can also be seen in testLogger.php file. Feel free to make any changes to the class and use it in the way you like. Though I do not commit anything but please suggest any improvements on

  Files folder image Files  
File Role Description
Plain text file PHPLogger.php Class Logger file to log debug information
Accessible without login Plain text file Readme.txt Doc. Gives the description about Logger class
Accessible without login Plain text file testLogger.php Example This file gives the example usage of PHPLogger class

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:3,871
This week:256Up