This library is a Fork of llaville/monolog-callbackfilterhandler with updates for Monolog 3.
This handler works with PHP 8.1 or above
Run
composer require mimmi20/monolog-callbackfilterhandler
- This handler obey first to basic Monolog rules as
handler level
andbubble
. - Then, in second time, logs are filtered by rules defined in one or more callback functions.
Main difference with FilterHandler included in standard Monolog distribution since version 1.8.0
FilterHandler
can just filter records and only allow those of a given list of levels through to the wrapped handler.CallbackFilterHandler
may filter records to the wrapped handler, on each standard record elements including extra data and logging context.
Here is a basic setup to log all events to a file and most important to another one (or notify by mail). See examples/basic.php file.
This package is licensed using the MIT License.
Please have a look at LICENSE.md
.