PHPackages                             zero1/module-custom-logging - 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. zero1/module-custom-logging

ActiveMagento2-module[Logging &amp; Monitoring](/categories/logging)

zero1/module-custom-logging
===========================

Allows you to configure different logging 'stacks' on a per environment basis. This would allow you to have a logging level of DEBUG on non\_production and ERROR on production.

1.0.1(6y ago)332proprietaryPHPPHP ~5.5.0|~5.6.0|^7.0.0

Since Jun 21Pushed 6y ago3 watchersCompare

[ Source](https://github.com/zero1limited/magento2-CustomLogging)[ Packagist](https://packagist.org/packages/zero1/module-custom-logging)[ Docs](https://packagist.org/packages/zero1/magento2-CustomLogging)[ RSS](/packages/zero1-module-custom-logging/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Custom Logging
==============

[](#custom-logging)

Allows configurable logging, on a per environment basis. Whilst still keeping the logging configuration in source control.

100% compatible with [Mdoq](https://www.mdoq.io)

To setup you will need to add the following snippets to the appropriate files.
On you production sites make sure you change the `stack` value to `production`.
In addition to this if you are running multiple webheads you can the `hardware_instance` value to identify each web head. eg `admin-01`, `web-asg-01` this will then be added to the logs.

env.php Config Example
----------------------

[](#envphp-config-example)

```
'logging' => [
        'hardware_instance' => 'server1-blahblah',
        'stack' => 'non_production'
    ],
```

config.php Config Example
-------------------------

[](#configphp-config-example)

```
'logging' => [
        'stacks' => [
            'production' => [
                'handlers' => [
                    'productionDefaultLogger' => [],
                ],
                'common_formatter' => \Monolog\Formatter\JsonFormatter::class,
                'common_processors' => [
                    \Monolog\Processor\GitProcessor::class,
                    \Monolog\Processor\IntrospectionProcessor::class,
                    \Monolog\Processor\WebProcessor::class,
                    \Zero1\CustomLogging\Logger\Processor\HardwareInstance::class,
                ]
            ],
            'non_production' => [
                'handlers' => [
                    'nonProductionDefaultLogger' => [],
                    'nonProductionDebugLogger' => [],
                ],
                'common_formatter' => 'loggingLineFormatter',
                'common_processors' => [
                    \Monolog\Processor\GitProcessor::class,
                    \Monolog\Processor\IntrospectionProcessor::class,
                    \Monolog\Processor\WebProcessor::class,
                    \Zero1\CustomLogging\Logger\Processor\HardwareInstance::class,
                ]
            ]
        ]
    ]
```

Additional Information
----------------------

[](#additional-information)

The changes you make in `app/etc/env.php` are meant to be environment specific. In here you can configure the logging 'stack' you want to use. This value will be out of source control. The 'stack' is purely a nice name to a set of logging configuration defined in `app/etc/config.php`. In `app/etc/config.php` you can configure as many different stacks as you want e.g 'production', 'staging', 'local'. Each of these stacks is stored in source control allowing the stacks to be used by anyone on your code base.

In addition to be able to change the 'stack' with a single environment value, we can also add additional things to all loggers, so that all messages get this info. The default example adds four 'processors' that add extra info.

```
'common_processors' => [
    \Monolog\Processor\GitProcessor::class,
    \Monolog\Processor\IntrospectionProcessor::class,
    \Monolog\Processor\WebProcessor::class,
    \Zero1\CustomLogging\Logger\Processor\HardwareInstance::class,
]
```

These will be added to all handlers:

```
'handlers' => [
    'nonProductionDefaultLogger' => [],
    'nonProductionDebugLogger' => [],
 ]
```

These link to the loggers that are defined in `etc/di.xml`

How this is different from Magento core:

- In magento core, you would have to make changes in source controlled files to change the logging verbosity. (Not ideal as production should have the same source files as staging, yet they should have different logging verbosity / settings)
- In magento core there is no way to configure different stacks of loggers.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

Every ~2 days

Total

2

Last Release

2517d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b08c35b603becab270a53db6ec969f48be0c353a20ee2985bb1a8ec5a9b64e9?d=identicon)[zero1](/maintainers/zero1)

---

Top Contributors

[![adamzero1](https://avatars.githubusercontent.com/u/6369163?v=4)](https://github.com/adamzero1 "adamzero1 (8 commits)")

---

Tags

loggingmagentologsmagento 2

### Embed Badge

![Health badge](/badges/zero1-module-custom-logging/health.svg)

```
[![Health](https://phpackages.com/badges/zero1-module-custom-logging/health.svg)](https://phpackages.com/packages/zero1-module-custom-logging)
```

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[analog/analog

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

3451.5M24](/packages/analog-analog)[phptek/sentry

Sentry.io integration for SilverStripe. Binds Sentry.io to SilverStripe's error &amp; exception handling subsystem.

15203.5k3](/packages/phptek-sentry)[ecocode/magento_profiler

Web Profiler for Magento 1.x

627.3k](/packages/ecocode-magento-profiler)

PHPackages © 2026

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