PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2018-08-19 (4 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 110 This week: 1All time: 8,988 This week: 289Up
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.

Name: Malik umer Farooq is available for providing paid consulting. Contact Malik umer Farooq .
Classes: 37 packages by
Country: Pakistan Pakistan
Age: 17
All time rank: 135518 in Pakistan Pakistan
Week rank: 20 Up1 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 2x

Details

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.

Requirement

  • PHP
  • Composer

install

run this command


## usage

<?php

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

## 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 readme.md 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  
 100%
Total:110
This week:1
All time:8,988
This week:289Up