merophp/log-manager

Logger manager for the Merophp Framework

0.1-alpha 2021-12-22 10:54 UTC

This package is auto-updated.

Last update: 2024-11-18 21:37:58 UTC


README

Logger Manager for the Merophp Framework. The manager holds PSR-3-based named loggers, so you can easily connect logging libraries or custom loggers to the framework.

Installation

Via composer:

composer require merophp/log-manager

Basic Usage

use Merophp\LogManager\LogManager;
use Merophp\LogManager\namedLogger\AbstractNamedLogger;

require_once dirname(__DIR__).'/vendor/autoload.php';

class MyLogger extends AbstractNamedLogger
{
    public function __construct(string $name)
    {
        $this->name = $name;
    }
}
$logManager = new LogManager;
$logManager->addLogger(new MyLogger('security');

$logManager->warning('security', 'My message');
$logManager->getLogger('security')->warning('My message');