PHPackages                             nemutaisama/zend-logger - 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. nemutaisama/zend-logger

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

nemutaisama/zend-logger
=======================

Few helpers for easy looging in Zend Framework 2

036PHP

Since Jun 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nemutaisama/ZendLogger)[ Packagist](https://packagist.org/packages/nemutaisama/zend-logger)[ RSS](/packages/nemutaisama-zend-logger/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#ZendLogger

Integration of any PSR-3 logger to ZendFramework2 projects. This package allow you easily log errors through EventManager.

INSTALL
=======

[](#install)

The recommended way to install is through composer.

```
{
    "require": {
        "nemutaisama/zend-logger": "*@dev"
    }
}
```

or just

`composer require nemutaisama/zend-logger:*@dev`

USAGE
=====

[](#usage)

1. Add `ZendLogger` to your `config/application.config.php` to enable module.
2. Configure any PSR-3 log service, and register it in ServiceManager.
3. Copy the config file `config/zendlogger.global.php.dist` from the module to config/autoload your project.

At this moment config is pretty simple - just set name of your log service. Default config use [EnliteMonolog package](https://github.com/enlitepro/enlite-monolog) with service name from default config.

```
    'ZendLogger' => 'YourLoggerServiceName'
```

Now you can use it.

This package come with set of ControllerPlugins and trait for model. From controller you can just use it.

```
class IndexController extends AbstractActionController {

    public function indexAction(){
        ...
        $this->debug('message', [context]);
        $this->info('message', [context]);
        $this->notice('message', [context]);
        $this->warning('message', [context]);
        $this->error('message', [context]);
        $this->critical('message', [context]);
        $this->alert('message', [context]);
        $this->emergency('message', [context]);
        $this->log($level, 'message', [context]);
        ...
    }
}
```

From model classes you can just use trait. Since package use EventManager you should have it available in class. For example by simply use Zend\\EventManager\\EventManagerAwareTrait. After that usage is same as in controller.

```
namespace MyPackage;

use ZendLogger\LoggerTrait;
use Zend\EventManager\EventManagerAwareTrait;

class MyModel {

    use LoggerTrait;
    use EventManagerAwareTrait;

    public function logErrors(){
        ...
        $this->debug('message', [context]);
        $this->info('message', [context]);
        $this->notice('message', [context]);
        $this->warning('message', [context]);
        $this->error('message', [context]);
        $this->critical('message', [context]);
        $this->alert('message', [context]);
        $this->emergency('message', [context]);
        $this->log($level, 'message', [context]);
        ...
    }
}
```

Events
======

[](#events)

You can also handle errors for anything else hooking events from shared event manager

```
    public function attach(EventManagerInterface $events)
    {
        $sharedEvents = $events->getSharedManager();
        $this->listeners[] = $sharedEvents->attach('*', 'log.emergency', array($this, 'onEmergency'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.alert', array($this, 'onAlert'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.critical', array($this, 'onCritical'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.error', array($this, 'onError'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.warning', array($this, 'onWarning'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.notice', array($this, 'onNotice'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.info', array($this, 'onInfo'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.debug', array($this, 'onDebug'), 100);
        $this->listeners[] = $sharedEvents->attach('*', 'log.message', array($this, 'onMessage'), 100);
    }
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/09805b2d98018f61b41d9c26d0fa5fdd878cc33e65999b9e04b215534379302a?d=identicon)[Nemutaisama](/maintainers/Nemutaisama)

---

Top Contributors

[![nemutaisama](https://avatars.githubusercontent.com/u/2156646?v=4)](https://github.com/nemutaisama "nemutaisama (3 commits)")

### Embed Badge

![Health badge](/badges/nemutaisama-zend-logger/health.svg)

```
[![Health](https://phpackages.com/badges/nemutaisama-zend-logger/health.svg)](https://phpackages.com/packages/nemutaisama-zend-logger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B10.9k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1938.5M261](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M315](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)

PHPackages © 2026

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