PHPackages                             jdz/monitor - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. jdz/monitor

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

jdz/monitor
===========

JDZ html formatter for debug

1.0.3(2mo ago)026MITPHPPHP &gt;=8.2

Since Dec 13Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/joffreydemetz/monitor)[ Packagist](https://packagist.org/packages/jdz/monitor)[ Docs](https://jdz.joffreydemetz.com/monitor)[ RSS](/packages/jdz-monitor/feed)WikiDiscussions main Synced today

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

JDZ Monitor
===========

[](#jdz-monitor)

Formatted HTML monitoring output for PHP processes. Build structured HTML reports (headings, paragraphs, lists, boxes, preformatted blocks) to display in a browser or send by email via `jdz/mailer`.

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

[](#installation)

```
composer require jdz/monitor
```

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

[](#requirements)

- PHP &gt;= 8.2

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

```
use JDZ\Monitor\Monitor;

$monitor = new Monitor();

$monitor->h1('Process Report');
$monitor->p('Process completed successfully.');
$monitor->p('42 items processed', 'Total');

echo (string)$monitor;
```

### Headings

[](#headings)

```
$monitor->h1('Title');      //
$monitor->h2('Subtitle');   //
// ... up to h6()
```

### Paragraphs

[](#paragraphs)

```
// Simple paragraph
$monitor->p('Some text');

// With a bold label prefix
$monitor->p('150ms', 'Duration');
// Output: Duration: 150ms

// With inline style
$monitor->p('All good', 'Status', 'color:green;');
```

### Lists

[](#lists)

```
$monitor->list([
    'Step 1: Data fetched',
    'Step 2: Data validated',
    'Step 3: Data imported',
]);
```

### Preformatted Content

[](#preformatted-content)

```
// String (newlines are converted to )
$monitor->pre("line 1\nline 2");

// Or an array of lines
$monitor->pre(['line 1', 'line 2']);
```

### Colored Boxes

[](#colored-boxes)

```
// Simple string box
$monitor->box('Some content', '#E8F5E9', '#1B5E20');

// Mixed content box with structured objects
$monitor->box([
    (object)['h' => 'Details', 'level' => 3],
    (object)['content' => '150ms', 'label' => 'Duration'],
    (object)['pre' => "SELECT * FROM users"],
    (object)['list' => ['cache: HIT', 'db: 2 queries']],
    'Plain string line',
]);
```

### Raw HTML

[](#raw-html)

```
$monitor->addHtmlString('');
```

### Checking for Content

[](#checking-for-content)

```
if ($monitor->hasContent()) {
    $html = (string)$monitor;
}
```

### Sending by Email

[](#sending-by-email)

Pair with `jdz/mailer` to email the report:

```
use JDZ\Monitor\Monitor;
use JDZ\Mailer\Mailer;

$monitor = new Monitor();
$monitor->h1('Cron Report');
$monitor->p('Everything OK');

$mail = new Mailer();
$mail->setContent([
    'isHtml' => true,
    'content' => (string)$monitor,
]);
$mail->addRecipient('admin@example.com');
$mail->set('subject', 'Cron Report');
$mail->send();
```

Fluent Interface
----------------

[](#fluent-interface)

All content methods return `$this`, so calls can be chained:

```
$monitor
    ->h1('Report')
    ->p('All systems operational')
    ->list(['API: OK', 'DB: OK', 'Cache: OK'])
    ->box('No errors', '#E8F5E9', '#1B5E20');
```

Testing
-------

[](#testing)

```
composer test
# or
vendor/bin/phpunit
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

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

Total

3

Last Release

85d ago

PHP version history (2 changes)1.0.2PHP &gt;=8.1

1.0.3PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e83e3701566e43438525ed14578487e732b849d152b5071aa1613a0dad96913?d=identicon)[jdz](/maintainers/jdz)

---

Top Contributors

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

---

Tags

htmlcoreutilitiesJDZ

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jdz-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/jdz-monitor/health.svg)](https://phpackages.com/packages/jdz-monitor)
```

PHPackages © 2026

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