https://github.com/llaville/monolog-callbackfilterhandler
Monolog handler wrapper that filters records based on a list of callback functions
https://github.com/llaville/monolog-callbackfilterhandler
monolog-handler
Last synced: about 1 month ago
JSON representation
Monolog handler wrapper that filters records based on a list of callback functions
- Host: GitHub
- URL: https://github.com/llaville/monolog-callbackfilterhandler
- Owner: llaville
- License: other
- Created: 2015-04-20T08:10:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-10T06:10:35.000Z (over 1 year ago)
- Last Synced: 2025-04-13T15:41:52.802Z (about 2 months ago)
- Topics: monolog-handler
- Language: PHP
- Homepage:
- Size: 56.6 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CallbackFilterHandler for Monolog
| Stable |
|:------:|
| [](https://packagist.org/packages/bartlett/monolog-callbackfilterhandler) |
| [](https://php.net/) |
| [](https://github.com/llaville/monolog-callbackfilterhandler) |
| [](https://github.com/llaville/monolog-callbackfilterhandler/actions) |## 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](http://getcomposer.org).
If you don't know yet what is composer, have a look [on introduction](http://getcomposer.org/doc/00-intro.md).```bash
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
## Features
* This handler obey first to basic Monolog rules as `handler level` and `bubble`.
* Then, in second time, logs are filtered by rules defined in one or more callback functions.Main difference with [FilterHandler](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/FilterHandler.php)
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](https://github.com/llaville/monolog-callbackfilterhandler/blob/master/examples/basic.php) file.## Authors
* Laurent Laville (Lead Developer)
* Christophe Coevoet (suggested the code base on discussion of Monolog
[PR#411](https://github.com/Seldaek/monolog/pull/411#issuecomment-53413159))## License
This handler is licensed under the BSD-3-clauses License - see the [LICENSE](https://github.com/llaville/monolog-callbackfilterhandler/blob/master/LICENSE) file for details