cruxoft / logbook
Simple wrapper for interaction with Monolog's Registry
0.1.3
2018-07-13 09:57 UTC
Requires
- php: ^7.0
- monolog/monolog: ^1.23
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2025-01-27 00:25:30 UTC
README
What is it?
Simple wrapper for interaction with Monolog's Registry system allowing legacy systems to benefit from modern logging.
For more complex Monolog setups with multiple channels and handlers a better solutions would be Monolog Cascade.
Installation
Can be installed using composer by running the following:
$ composer require cruxoft/logbook
Usage
A simple but common usage of Logbook would be as follows:
use Cruxoft\Logbook; use Monolog\Handler\StreamHandler; use Monolog\Logger; // Generate one or more handlers $handler = new StreamHandler("./sample.log", Logger::ERROR); // Add a log channel with specified handlers, optional processors can also be added Logbook::add("my_log_channel", array($handler)); // Raising a log, standard monolog methods can be used eg. error() err(), addError() Logbook::get("my_log_channel")->error("This is just an example");