PHPackages                             bartlett/monolog-callbackfilterhandler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. bartlett/monolog-callbackfilterhandler

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

bartlett/monolog-callbackfilterhandler
======================================

Monolog handler wrapper that filters records based on a list of callback functions

2.1.0(3y ago)7124.8k34BSD-3-ClausePHPPHP ^7.2 || ^8.0CI failing

Since Apr 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/llaville/monolog-callbackfilterhandler)[ Packagist](https://packagist.org/packages/bartlett/monolog-callbackfilterhandler)[ RSS](/packages/bartlett-monolog-callbackfilterhandler/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (6)Used By (4)

CallbackFilterHandler for Monolog
=================================

[](#callbackfilterhandler-for-monolog)

Stable[![Latest Stable Version](https://camo.githubusercontent.com/514f4d6cd89ab68af31a3f95d87c007b48c01f66159ba0302e926754bd424a35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626172746c6574742f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c6572)](https://packagist.org/packages/bartlett/monolog-callbackfilterhandler)[![Minimum PHP Version)](https://camo.githubusercontent.com/6d315756aacd024d622d026336e548923b57d64ee3e1344936d5f3c00cd5be45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f626172746c6574742f6d6f6e6f6c6f672d63616c6c6261636b66696c74657268616e646c6572)](https://php.net/)[![Branch Master](https://camo.githubusercontent.com/d0bad8a4c63758bbc6b640ff0474203ccaaa57d7e5aa679623706c9277cc1c04/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6272616e63682d6d61737465722d626c7565)](https://github.com/llaville/monolog-callbackfilterhandler)[![Tests](https://github.com/llaville/php-compatinfo-db/workflows/Tests/badge.svg)](https://github.com/llaville/monolog-callbackfilterhandler/actions)Requirements
------------

[](#requirements)

This handler works with PHP 7.2 or above, use release 1.0.0 for PHP 5.3+ support

Installation
------------

[](#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).

```
composer require bartlett/monolog-callbackfilterhandler
```

Support
-------

[](#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
-------------

[](#documentation)

- release 1.0.0 is fully documented at

Features
--------

[](#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
-------

[](#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
-------

[](#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
-------

[](#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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 85.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~659 days

Total

5

Last Release

1453d ago

Major Versions

1.x-dev → 2.0.02021-07-20

PHP version history (4 changes)1.0.0PHP &gt;=5.3.0

1.x-devPHP ^5.3|^7.0

2.0.0PHP ^7.2|^8.0

2.1.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/555d494363fdc69e712d56b46d3b9bf3fe221f2dae8a0cf3c732b0138d54f192?d=identicon)[llaville](/maintainers/llaville)

---

Top Contributors

[![llaville](https://avatars.githubusercontent.com/u/364342?v=4)](https://github.com/llaville "llaville (35 commits)")[![weirdan](https://avatars.githubusercontent.com/u/57403?v=4)](https://github.com/weirdan "weirdan (5 commits)")[![mimmi20](https://avatars.githubusercontent.com/u/1120192?v=4)](https://github.com/mimmi20 "mimmi20 (1 commits)")

---

Tags

monolog-handlerloglogginghandlerlogger

### Embed Badge

![Health badge](/badges/bartlett-monolog-callbackfilterhandler/health.svg)

```
[![Health](https://phpackages.com/badges/bartlett-monolog-callbackfilterhandler/health.svg)](https://phpackages.com/packages/bartlett-monolog-callbackfilterhandler)
```

###  Alternatives

[logtail/monolog-logtail

Logtail handler for Monolog

243.6M3](/packages/logtail-monolog-logtail)[inpsyde/wonolog

Monolog-based logging package for WordPress.

184637.3k7](/packages/inpsyde-wonolog)[amphp/log

Non-blocking logging for PHP based on Amp, Revolt, and Monolog.

402.9M82](/packages/amphp-log)[dakatsuka/monolog-fluent-handler

Fluentd Handler for Monolog

11480.9k](/packages/dakatsuka-monolog-fluent-handler)[mhcg/monolog-wp-cli

Extension for Monolog to support outputting to WP-CLI (The WordPress command line interface) when running wp command lines.

10112.6k1](/packages/mhcg-monolog-wp-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
