PHP Classes

PHP Logger class: Log messages with different levels of severity

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 171 All time: 8,699 This week: 175Up
Version License PHP version Categories
php-logger-class 1.0.0MIT/X Consortium ...5PHP 5, Logging
Description Author

This package can log messages with different levels of priority.

It can take a string as parameters with the message to log and append it to a log file according to a given severity level.

The package supports several levels of severity like emergency, alert, critical, error, warning, notice, info and debug.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 49 packages by
Country: Pakistan Pakistan
Age: 20
All time rank: 92411 in Pakistan Pakistan
Week rank: 40 Up3 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 5x


PHP Logger

Logging is one of the most ubiquitous tasks encountered in PHP. We use logs to track error messages, record important events, and debug problems with our code this class exectly do this.


  • PHP
  • Composer


run this command

## usage


use Lablnet\Logger;
require '../vendor/autoload.php';
$logger = new Logger;
$logger->debug("Hi im log msg and im {field}" , ['field' => 'debug']);

## Levels
- emergency => ```$logger->emergency(msg,[context])```
- alert => ```$logger->alert(msg,[context])```
- critical => ```$logger->emergency(msg,[critical])```
- error => ```$logger->error(msg,[context])```
- warning => ```$logger->warning(msg,[context])```
- notice => ```$logger->notice(msg,[context])```
- info => ```$logger->info(msg,[context])```
- debug => ```$logger->debug(msg,[context])```

# Note: .logs file will save in root of project directory 
  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (3 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Read me first

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file AbstractLogger.php Class Class source
  Plain text file Logger.php Class Class source
  Plain text file LogLevel.php Class Class source

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