Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 182 | | All time: 8,697 This week: 571 |
|
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. | |
|
|
Innovation award
Nominee: 6x |
|
Example
<?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());
|
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
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
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.