bartlett / monolog-callbackfilterhandler
Monolog handler wrapper that filters records based on a list of callback functions
Installs: 118 796
Dependents: 3
Suggesters: 3
Security: 0
Stars: 7
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- ext-json: *
- monolog/monolog: ^2.0
README
Requirements
This handler works with PHP 7.2 or above, use release 1.0.0 for PHP 5.3+ support
Installation
The recommended way to install this library is through composer. If you don't know yet what is composer, have a look on introduction.
composer require bartlett/monolog-callbackfilterhandler
Support
- release 1.0.0 is not maintained except for bug report, and will accept only Monolog v1.
- release 2.0.0 is the current active version, and accept only Monolog v2
Documentation
- release 1.0.0 is fully documented at http://php5.laurent-laville.org/callbackfilterhandler/
Features
- 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.
Example
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.
Authors
- Laurent Laville (Lead Developer)
- Christophe Coevoet (suggested the code base on discussion of Monolog PR#411)
License
This handler is licensed under the BSD-3-clauses License - see the LICENSE file for details