PHPackages                             johnnynotsolucky/monolog-regex-handler - 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. johnnynotsolucky/monolog-regex-handler

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

johnnynotsolucky/monolog-regex-handler
======================================

Regex log filter handler for Monolog

1.0.0(5y ago)011MITPHPPHP ^7.2 || ^8

Since Jan 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/johnnynotsolucky/monolog-regex-handler)[ Packagist](https://packagist.org/packages/johnnynotsolucky/monolog-regex-handler)[ Docs](https://github.com/johnnynotsolucky/monolog-regex-handler)[ RSS](/packages/johnnynotsolucky-monolog-regex-handler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Regex Filter for Monolog
========================

[](#regex-filter-for-monolog)

[Monolog](https://github.com/Seldaek/monolog) handler for filtering out logs with regular expressions.

Requirements
------------

[](#requirements)

- PHP ^7.2 or ^8
- Monolog ^2.0

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

[](#installation)

```
composer require johnnynotsolucky/monolog-regex-handler:^1.0
```

Motivation
----------

[](#motivation)

> But why do I need to filter out logs when I control the logs?

Sometimes you don't 😢.

Usage
-----

[](#usage)

```
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use johnnynotsolucky\RegexHandler\Handler as RegexHandler;

$handler = new RegexHandler([
    '/^spam log$/', // Match on the message
    ['level_name', '/^(INFO|DEBUG)$/'], // Match on the level_name
    [['context', 'email'], '/@domain\.com$/'] // Match on context->email
]);

$log = new Logger('test');

$log->pushHandler(new StreamHandler('php://stdout'));
$log->pushHandler($handler);

$log->warning('spam log');  // Discarded
$log->info('message'); // INFO and DEBUG logs are discarded
$log->warning('message', ['email' => 'someone@domain.com']); // Discarded on email
```

License
-------

[](#license)

This project is licensed under [the Parity License](LICENSE-PARITY.md). Third-party contributions are licensed under [Apache-2.0](LICENSE-APACHE.md)and belong to their respective authors.

The Parity License is a copyleft license that, unlike the GPL family, allows you to license derivative and connected works under permissive licenses like MIT or Apache-2.0.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1935d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2762e2661abbacdddd4d19cad2d1628bb0f3ba03d95059fd486564c2f342ce8d?d=identicon)[johnnynotsolucky](/maintainers/johnnynotsolucky)

---

Top Contributors

[![johnnynotsolucky](https://avatars.githubusercontent.com/u/4161106?v=4)](https://github.com/johnnynotsolucky "johnnynotsolucky (7 commits)")

---

Tags

monolog

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/johnnynotsolucky-monolog-regex-handler/health.svg)

```
[![Health](https://phpackages.com/badges/johnnynotsolucky-monolog-regex-handler/health.svg)](https://phpackages.com/packages/johnnynotsolucky-monolog-regex-handler)
```

###  Alternatives

[maxbanton/cwh

AWS CloudWatch Handler for Monolog library

42515.3M27](/packages/maxbanton-cwh)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k6](/packages/inpsyde-wonolog)[phpnexus/cwh

AWS CloudWatch Handler for Monolog library

393.2M7](/packages/phpnexus-cwh)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[kdyby/monolog

Integration of Monolog into Nette Framework

33684.0k10](/packages/kdyby-monolog)[inpsyde/logzio-monolog

Logz.io integration for Monolog

191.2M1](/packages/inpsyde-logzio-monolog)

PHPackages © 2026

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