PHPackages                             alexandre-daubois/monolog-processor-collection - 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. alexandre-daubois/monolog-processor-collection

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

alexandre-daubois/monolog-processor-collection
==============================================

A collection of Monolog processors

1.3.2(2y ago)1516.6k↓46.2%1[1 issues](https://github.com/alexandre-daubois/monolog-processor-collection/issues)MITPHPPHP &gt;=8.1

Since Nov 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alexandre-daubois/monolog-processor-collection)[ Packagist](https://packagist.org/packages/alexandre-daubois/monolog-processor-collection)[ RSS](/packages/alexandre-daubois-monolog-processor-collection/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (15)Used By (0)

Monolog Processor Collection
============================

[](#monolog-processor-collection)

[![Minimum PHP Version](https://camo.githubusercontent.com/2d18ce514c7016022dad012ac9e39a8b6f47cc411b2daff6627cbf208f8cea63/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![CI](https://github.com/alexandre-daubois/monolog-processor-collection/actions/workflows/php.yml/badge.svg)](https://github.com/alexandre-daubois/monolog-processor-collection/actions/workflows/php.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/69d4d3baf344bdbf50bfb13f14229171ec1b41ef2d9366ed4b1f79bef59766d0/687474703a2f2f706f7365722e707567782e6f72672f616c6578616e6472652d646175626f69732f6d6f6e6f6c6f672d70726f636573736f722d636f6c6c656374696f6e2f762f737461626c65)](https://packagist.org/packages/alexandre-daubois/monolog-processor-collection)[![License](https://camo.githubusercontent.com/ea43b6bac2e0324eb96412a789a468ea2567af653e5f8db6eac8d1f441259acf/687474703a2f2f706f7365722e707567782e6f72672f616c6578616e6472652d646175626f69732f6d6f6e6f6c6f672d70726f636573736f722d636f6c6c656374696f6e2f6c6963656e7365)](https://packagist.org/packages/alexandre-daubois/monolog-processor-collection)

Welcome to the Monolog Processor Collection (MPC) - the ultimate suite of processors designed to enhance your logging with the renowned [Monolog](https://github.com/Seldaek/monolog) library. This toolkit is meticulously crafted to integrate seamlessly with PHP 8.1+, ensuring your logging captures the comprehensive details you need with minimal overhead.

MPC is engineered for developers who demand more from their logs. Whether you're tracking down elusive bugs or monitoring live production environments, processors enrich your log entries with invaluable context, turning ordinary logs into a rich, actionable dataset.

MPC is compatible with worker mode of web servers, as relevant processors implement the `ResettableInterface`.

Available Processors
--------------------

[](#available-processors)

The package provides the following processors:

- `BacktraceProcessor` adds the backtrace to the log record
- `ClientIpProcessor` adds the client IP address to the log record
- `EnvVarProcessor` adds the value of one or more environment variables to the log record
- `HighResolutionTimestampProcessor` adds the high resolution time to the log record
- `IsHttpsProcessor` adds a boolean value indicating whether the request is a secured HTTP request to the log record
- `PhpIniValueProcessor` adds the value of one or more PHP ini settings to the log record
- `ProtocolVersionProcessor` adds the HTTP protocol version to the log record
- `RequestSizeProcessor` adds the size of the request to the log record, headers included, in bytes
- `ResourceUsagesProcessor` adds the resource usage to the log record as returned by [getrusage()](https://www.php.net/manual/en/function.getrusage.php)
- `SapiNameProcessor` adds the name of the SAPI to the log record
- `SessionIdProcessor` adds the session ID to the log record, or null if no session is active
- `UuidProcessor` adds a UUID v7 to the log record to track records triggered during the same request

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

[](#installation)

The recommended way to install MPC is through [Composer](https://getcomposer.org/):

```
composer require alexandre-daubois/monolog-processor-collection
```

Usage
-----

[](#usage)

All processor can be used in the same way as any other Monolog processor. For example:

```
use Monolog\Logger;

$logger = new Logger('name');
$logger->pushProcessor(new BacktraceProcessor());
```

Some processors, like `EnvVarProcessor` and `PhpIniValueProcessor`, require you to specify more arguments. For example:

```
use Monolog\Logger;

$logger = new Logger('name');
$logger->pushProcessor(new EnvVarProcessor(['APP_ENV', 'APP_DEBUG']));
```

Integration with Symfony and MonologBundle
------------------------------------------

[](#integration-with-symfony-and-monologbundle)

You can register those processors to be used with Symfony and MonologBundle by adding the following configuration to your `config/packages/monolog.php` file:

```
use Monolog\Processor\ProcessorInterface;
use MonologProcessorCollection\BacktraceProcessor;
use MonologProcessorCollection\EnvVarProcessor;
use MonologProcessorCollection\ProtocolVersionProcessor;
use MonologProcessorCollection\EnvVarProcessor;
use MonologProcessorCollection\SapiNameProcessor;

return static function (ContainerConfigurator $configurator): void {
    // ...

    // register as many processors as you like, but keep in mind that
    // each processor is called for each log record
    $services = $configurator->services();
    $services
        ->set(BacktraceProcessor::class)
        ->set(EnvVarProcessor::class)->args(['APP_ENV'])
        ->set(ProtocolVersionProcessor::class)
        ->set(SapiNameProcessor::class);

    // ...
};
```

If you don't use autoconfigure, you need to tag the processors with `monolog.processor`:

```
return static function (ContainerConfigurator $configurator): void {
    // ...

    $services = $configurator->services();
    $services
        ->set(BacktraceProcessorAlias::class)
            ->tag('monolog.processor', ['handler' => 'main'])
        ->set(EnvVarProcessor::class)->args(['APP_ENV'])
            ->tag('monolog.processor', ['handler' => 'main']);

    // ...
};
```

You can achieve the same configuration with YAML:

```
# config/packages/monolog.yaml
services:
    MonologProcessorCollection\BacktraceProcessor:
        tags:
            - { name: monolog.processor, handler: main }
    MonologProcessorCollection\EnvVarProcessor:
        arguments:
            - APP_ENV
        tags:
            - { name: monolog.processor, handler: main }
```

Or XML:

```

    APP_ENV

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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 ~6 days

Recently: every ~11 days

Total

9

Last Release

877d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4df244f8a69ff326bf04b0eafa163051f41826db1ffeb8ffa6b5b7fc425e6b9e?d=identicon)[alexandre-daubois](/maintainers/alexandre-daubois)

---

Top Contributors

[![alexandre-daubois](https://avatars.githubusercontent.com/u/2144837?v=4)](https://github.com/alexandre-daubois "alexandre-daubois (16 commits)")[![ToshY](https://avatars.githubusercontent.com/u/31921460?v=4)](https://github.com/ToshY "ToshY (1 commits)")

---

Tags

logloggerloggingmonologmonolog-processorpsr-3psr3logpsr-3loggingcollectionPSR3monologprocessorpsr-3-loggerpsr3-loggerpsr-3-loggingpsr3-logging

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/alexandre-daubois-monolog-processor-collection/health.svg)

```
[![Health](https://phpackages.com/badges/alexandre-daubois-monolog-processor-collection/health.svg)](https://phpackages.com/packages/alexandre-daubois-monolog-processor-collection)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[lefuturiste/monolog-discord-handler

A simple monolog handler for support Discord webhooks

34111.6k4](/packages/lefuturiste-monolog-discord-handler)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[atrapalo/monolog-elasticsearch

A Monolog handler and formatter that makes use of the elasticsearch/elasticsearch package

1123.0k](/packages/atrapalo-monolog-elasticsearch)[filips123/monolog-phpmailer

PHPMailer handler for Monolog

1365.6k3](/packages/filips123-monolog-phpmailer)

PHPackages © 2026

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