Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lablnet/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.
https://github.com/lablnet/php-logger
composer free logger package php psr-3
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/lablnet/php-logger
- Owner: lablnet
- License: mit
- Created: 2018-08-19T07:52:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T08:55:28.000Z (over 6 years ago)
- Last Synced: 2024-04-20T08:02:52.122Z (9 months ago)
- Topics: composer, free, logger, package, php, psr-3
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
``` composer require lablnet/logger ```## usage
```php
setFile(filewithpath);
// $logger->setFile("../my.logs");
$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])```## custom file
For setting your own custom file
``` $logger->setFile("data/app.logs"); ```# Note: .logs file will save in root of project directory