Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danteay/corephp-log


https://github.com/danteay/corephp-log

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# corephp-log

An easy log system for php webapps

## Basic use

```php
use CorePHP\Log\Logger;
use CorePHP\Log\Handlers\FileHandler;
use CorePHP\Log\Formatters\WebFormatter;
use CorePHP\Log\Handlers\StdoutHandler;

$logger = new Logger('TEST');
$formatter = new WebFormatter();

$handler = new FileHandler(__DIR__ . '/logger.log');
$handler1 = new StdoutHandler(true);
$handler->setFormatt($formatter);
$handler1->setFormatt($formatter);

$logger->addHandler($handler);
$logger->addHandler($handler1);

$logger->error('Mensaje random');
```