PHPackages                             schema31/php-monitoring - 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. schema31/php-monitoring

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

schema31/php-monitoring
=======================

0.0.1(5y ago)018PHP

Since Sep 8Pushed 5y ago2 watchersCompare

[ Source](https://github.com/Schema31/php-monitoring)[ Packagist](https://packagist.org/packages/schema31/php-monitoring)[ RSS](/packages/schema31-php-monitoring/feed)WikiDiscussions master Synced 5d ago

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

php-monitoring
==============

[](#php-monitoring)

======

[Packagist](https://packagist.org/packages/schema31/php-monitoring)

Logger class for PHP. It require the [Schema31/php-gcloud-monitoring-sdk](https://github.com/Schema31/php-gcloud-monitoring-sdk)

Install
-------

[](#install)

You can install the library using [composer](https://getcomposer.org/):

```
$ composer require schema31/php-monitoring
```

How to use
----------

[](#how-to-use)

Configurations
--------------

[](#configurations)

### Internal configuration

[](#internal-configuration)

You can pass the configuration values:

```
use Schema31\PhpMonitoring\Logger;
use Schema31\PhpMonitoring\LoggerConstants;

...

$logger = new Logger("streamName", "authentication", LoggerConstants::REST, LoggerConstants::DEBUG);
```

### Configuration constants

[](#configuration-constants)

You can define constants and the library use it automatically:

```
use Schema31\PhpMonitoring\Logger;
use Schema31\PhpMonitoring\LoggerConstants;

...

define('LOGGER_STREAMNAME', 'streamName');
define('LOGGER_AUTHENTICATION', 'authentication');
define('LOGGER_PROTOCOL', LoggerConstants::REST);
define('LOGGER_THRESHOLD', LoggerConstants::DEBUG);

$logger = new Logger();
```

Sending a message
-----------------

[](#sending-a-message)

```
//Method chaining is allowed
$logger->setProtocol(LoggerConstants::REST) //if you want to ovverride the default
->setLevel(LoggerConstants::ALERT)
->setFacility("PhpMonitoring")
->setFile(__FILE__)
->setLine(__LINE__)
->setShortMessage("Short Message " . uniqid())
->setFullMessage("Full Message")
->setSingleAdditional("key1", "value1")
->publish();
```

Sending an exception
--------------------

[](#sending-an-exception)

You can send a log based on an exception:

```
try{
    throw new \Exception("Test Exception");
}catch(\Exception $exc){
    $logger
    ->setException($exc)
    ->publish();
}
```

Or

```
try{
    throw new \Exception("Test Exception");
}catch(\Exception $exc){
    $logger
    ->setException($exc)
    ->setFacility("PhpMonitoring") //You can override the facility of the exception
    ->setLevel(LoggerConstants::CRITICAL) //You can override the level of the exception
    ->setSingleAdditional("key1", "value1") //You can add other additionals
    ->publish();
}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

2077d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/848636d8da9389154acabd22a7fc46a7b876730adff2070e56a19d1d89f90af6?d=identicon)[gabriele120987](/maintainers/gabriele120987)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/schema31-php-monitoring/health.svg)

```
[![Health](https://phpackages.com/badges/schema31-php-monitoring/health.svg)](https://phpackages.com/packages/schema31-php-monitoring)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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