PHPackages                             zendtech/zendhq-monolog-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. zendtech/zendhq-monolog-handler

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

zendtech/zendhq-monolog-handler
===============================

Monolog handler that writes to ZendHQ monitoring

0.1.2(1y ago)0263BSD-3-ClausePHPPHP ^7.3.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

Since Aug 24Pushed 1y ago2 watchersCompare

[ Source](https://github.com/zendtech/zendhq-monolog-handler)[ Packagist](https://packagist.org/packages/zendtech/zendhq-monolog-handler)[ RSS](/packages/zendtech-zendhq-monolog-handler/feed)WikiDiscussions 0.1.x Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

zendtech/zendhq-monolog-handler
===============================

[](#zendtechzendhq-monolog-handler)

This project provides a handler for [Monolog](https://seldaek.github.io/monolog/) that pushes to [ZendHQ](https://www.zend.com/products/zendphp-enterprise/zendhq) monitoring.

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

[](#installation)

```
composer require zendtech/zendhq-monolog-handler
```

### Requirements

[](#requirements)

- A ZendHQ node
- ZendPHP &gt;= 7.2
- The ZendHQ extension
- Monolog 2.4+ or 3.4+

Usage
-----

[](#usage)

The below examples demonstrate how to create a `ZendHQHandler` instance for use in writing logs with Monolog.

### Default instantiation

[](#default-instantiation)

Default usage is to use Monolog/PSR-3 log levels to indicate severity. You can instantiate the provided `ZendTech\ZendHQ\MonologHandler\ZendHQHandler` class without any arguments, or with the `$level` and/or `$bubble` arguments:

```
use Monolog\Logger;
use ZendTech\ZendHQ\MonologHandler\ZendHQHandler;

// PHP 7:
// - Default level (DEBUG) and allowing bubbling:
$handler = new ZendHQHandler();

// - Setting a level mask of warnings or greater only:
$handler = new ZendHQHandler(null, Logger::WARNING);

// - Default level (DEBUG), but disallowing bubbling
$handler = new ZendHQHandler(null, Logger::DEBUG, false);

// PHP 8:
// - Default level (DEBUG) and allowing bubbling:
$handler = new ZendHQHandler();

// - Setting a level mask of warnings or greater only:
$handler = new ZendHQHandler(level: Logger::WARNING);

// - Default level (DEBUG), but disallowing bubbling
$handler = new ZendHQHandler(bubble: false);
```

### Instantiation for usage with named rules

[](#instantiation-for-usage-with-named-rules)

ZendHQ custom monitoring rules will specify severity in the rule definition, so severity is ignored. To use such custom rules, provide the custom rule name when instantiating `ZendHQHandler`. The following examples target a "my\_custom\_rule" rule. While you *can* provide a default level to handle, the value will not be sent to ZendHQ, and only used to determine if a message will get logged.

```
use Monolog\Logger;
use ZendTech\ZendHQ\MonologHandler\ZendHQHandler;

// PHP 7:
// - Default level (DEBUG) and allowing bubbling:
$handler = new ZendHQHandler('my_custom_rule');

// - Setting a level mask of warnings or greater only:
$handler = new ZendHQHandler('my_custom_rule', Logger::WARNING);

// - Default level (DEBUG), but disallowing bubbling
$handler = new ZendHQHandler('my_custom_rule', Logger::DEBUG, false);

// PHP 8:
// - Default level (DEBUG) and allowing bubbling:
$handler = new ZendHQHandler('my_custom_rule');

// - Setting a level mask of warnings or greater only:
$handler = new ZendHQHandler('my_custom_rule', level: Logger::WARNING);

// - Default level (DEBUG), but disallowing bubbling
$handler = new ZendHQHandler('my_custom_rule', bubble: false);
```

### Formatters and Processors

[](#formatters-and-processors)

The `ZendHQHandler` implements each of `Monolog\Handler\ProcessableHandlerInterface` and `Monolog\Handler\FormattableHandlerInterface`. As such, you can attach processors and formatters to your handler in order to manipulate the information logged. See the [Monolog documentation on formatters and processors](http://seldaek.github.io/monolog/doc/02-handlers-formatters-processors.html) for more details.

As examples:

```
$handler->setFormatter(new \Monolog\Formatter\LineFormatter());
$handler->pushProcessor(new \Monolog\Processor\PsrLogMessageProcessor());
```

### Adding the handler to Monolog

[](#adding-the-handler-to-monolog)

Monolog writes to *channels*, which are essentially just a way of partitioning different logs from each other.

```
use Monolog\Logger;

$logger = new Logger('channel_name');
```

From here, you need to add the handler to the logger:

```
// Where $handler is the instance created via one of the examples in previous sections
$logger->pushHandler($handler);
```

To log, use one of the various logging methods of the `$logger` instance:

```
$logger->warning('This is a warning!');
```

Notes
-----

[](#notes)

- The channel name is sent to ZendHQ monitoring events as the *type*; you will see this in the event drawer.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~153 days

Total

4

Last Release

531d ago

PHP version history (3 changes)0.1.0PHP ^7.3.0 || ~8.0.0 || ~8.1.0 || ~8.2.0

0.1.1PHP ^7.3.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

0.1.2PHP ^7.3.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25943?v=4)[Matthew Weier O'Phinney](/maintainers/weierophinney)[@weierophinney](https://github.com/weierophinney)

---

Top Contributors

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

---

Tags

psr-3monologzendhq

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zendtech-zendhq-monolog-handler/health.svg)

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

###  Alternatives

[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[bitrix-expert/monolog-adapter

Monolog adapter for Bitrix CMS

6566.3k](/packages/bitrix-expert-monolog-adapter)[staabm/phpstan-psr3

23427.3k2](/packages/staabm-phpstan-psr3)[filips123/monolog-phpmailer

PHPMailer handler for Monolog

1365.6k3](/packages/filips123-monolog-phpmailer)[alexandre-daubois/monolog-processor-collection

A collection of Monolog processors

1516.6k](/packages/alexandre-daubois-monolog-processor-collection)

PHPackages © 2026

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