stuzzo / monolog-extender
Monolog wrapper that extends formatters and processors to add further informations
Installs: 5 694
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.0
- monolog/monolog: ^1.23
Requires (Dev)
- phpunit/phpunit: ~4.5
Suggests
- stuzzo/monolog-extender-bundle: Add monolog extender functionalities to Symfony
README
Monolog sends your logs to files, sockets, inboxes, databases and various web services. See the complete reference
This library extends Monolog's handlers and processors adding data to the record generated from processors. Furthermore the library improves logs format.
Installation
Install the latest version with
$ composer require stuzzo/monolog-extender
Basic Usage
<?php use Monolog\Logger; use Monolog\Handler\StreamHandler; // create a log channel $log = new Logger('request'); $handler = new StreamHandler('path/to/your.log', Logger::WARNING); $formatter = new \Stuzzo\Monolog\Formatter\StreamFormatter(null, 'Y-m-d H:i:s'); $handler->setFormatter($formatter); $log->pushHandler($handler); try { throw new \RuntimeException('Something happen'); } catch (\Exception $exception) { $log->critical('Error', ['exception' => $exception]); }
Documentation
About
Requirements
- This library works with PHP 5.5.9 or above.
Author
Alfredo Aiello - stuzzo@gmail.com - http://twitter.com/stuzzo