PHPackages                             orinokko/state-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. orinokko/state-monitor

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

orinokko/state-monitor
======================

State Monitor

0.7.0(6y ago)0190GPL-3.0-or-laterPHPPHP &gt;= 7.1CI failing

Since May 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/orinokko/state-monitor)[ Packagist](https://packagist.org/packages/orinokko/state-monitor)[ Docs](https://github.com/orinokko/state-monitor)[ RSS](/packages/orinokko-state-monitor/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (4)Versions (28)Used By (0)

application part of state-monitor
=================================

[](#application-part-of-state-monitor)

[![Packagist](https://camo.githubusercontent.com/3619cc25383b8bfec976fd2eef02d6f4ac6a3f0c1bb0c6bbf22ac9e6be5c10aa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f72696e6f6b6b6f2f73746174652d6d6f6e69746f722e737667)](https://packagist.org/packages/orinokko/state-monitor)[![build status](https://camo.githubusercontent.com/b82d6c0d9555103c386d2fa6dbf35d94a5c1330ff25f0c074020d961a0cc80be/68747470733a2f2f636972636c6563692e636f6d2f67682f6f72696e6f6b6b6f2f73746174652d6d6f6e69746f722f747265652f6d61737465722e7376673f7374796c653d73766726636972636c652d746f6b656e3d38333464333632653531363136326638323166613933393237646133646565313734313230656430)](https://circleci.com/gh/orinokko/state-monitor/tree/master)

Collects data about exceptions, manual events and some logs. Supports writing to BigQuery. For further data analysis, you can use Google Data Studio or your own application.

For example: [![Errors](https://raw.githubusercontent.com/orinokko/state-monitor/work/docs/img/1.png)](https://raw.githubusercontent.com/orinokko/state-monitor/work/docs/img/1.png)

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

[](#installation)

### 1. Require the Package

[](#1-require-the-package)

```
composer require orinokko/state-monitor
```

### 2. Add to .env

[](#2-add-to-env)

The service identifier of your application

```
STATE_MONITOR_APP=AppName

```

Whether or not to use mailing for errors

```
STATE_MONITOR_LOCAL_EMAIL=true
STATE_MONITOR_ALERT_EMAIL=mail@example.com

```

Whether or not to use BigQuery

```
STATE_MONITOR_BIGQUERY=true

```

Settings for BigQuery, more [details](https://github.com/googleapis/google-cloud-php/blob/master/AUTHENTICATION.md)

```
STATE_MONITOR_GOOGLE_CLOUD_PROJECT=[monitor-123456]
STATE_MONITOR_GOOGLE_APPLICATION_CREDENTIALS=[storage/monitor.json]

```

Whether or not to log queries

```
STATE_MONITOR_LOG_QUERIES=false

```

Enable or disable kernel middleware (default "true"-enabled)

```
STATE_MONITOR_MIDDLEWARE_WEB=false
STATE_MONITOR_MIDDLEWARE_API=false

```

### 3. Run config test and installation

[](#3-run-config-test-and-installation)

```
php artisan monitor:install
```

You must get one of or both lines

```
Local email channel activated and recipient address provided.
BigQuery channel activated and connection settings provided.
```

In the process, additional actions will be performed:

1. If sending by email is activated, a test letter will be sent to the specified address (using application mail settings).
2. If saving in BigQuery is activated, the existence of the “monitor” data set will be checked. And it will be created if there is no such data set yet. Also the existence of tables "errors", "events", "checks", "queries" will be checked. If they are not there they will be created.

Example output after installation:

```
public_html$ php artisan monitor:install
Current settings:
STATE_MONITOR_APP=TestAppName
STATE_MONITOR_LOCAL_EMAIL=
STATE_MONITOR_ALERT_EMAIL=mail@example.com
STATE_MONITOR_BIGQUERY=1
STATE_MONITOR_GOOGLE_CLOUD_PROJECT=monitor
STATE_MONITOR_GOOGLE_APPLICATION_CREDENTIALS=/storage/monitor.json
STATE_MONITOR_LOG_QUERIES=1
STATE_MONITOR_MIDDLEWARE_WEB=
STATE_MONITOR_MIDDLEWARE_API=
Local email channel disabled.
BigQuery channel activated and connection settings provided. Try configure the database...
Dataset already exist.
Table for errors already exist.
Table for checks already exist.
Table for events already exist.
Table for queries already exist.
```

### 4. Publish assets

[](#4-publish-assets)

```
php artisan vendor:publish --provider='Orinoko\StateMonitor\MonitorServiceProvider' --tag='public' --force
```

Advices
-------

[](#advices)

### If the site package is used in different applications

[](#if-the-site-package-is-used-in-different-applications)

Ensure that real data is listed in APP\_NAME and APP\_URL. They are can be used to find the sender.

Usage
-----

[](#usage)

### Exceptions monitoring

[](#exceptions-monitoring)

Exceptions automatically will be caught on web and api middleware groups. You can disable this middleware in .env file.

Also exist middleware for custom routes and other:

```
->middleware('state-monitor-errors')
```

### Checks monitoring

[](#checks-monitoring)

Called manually

```
Monitor::validateRequest($type,$url,$method,$params=[],$user='',$domain='')
```

### Events monitoring

[](#events-monitoring)

Called manually

```
Monitor::storeEvent($message,$priority=0,$url='',$method='',$params=[],$user='',$domain='')
```

### Database monitoring

[](#database-monitoring)

If STATE\_MONITOR\_LOG\_QUERIES is enabled, it will automatically log all queries to the appropriate table.

### Front

[](#front)

After publishing assets add to html

```

```

Calling

```

    if (typeof monitorAddEvent === "function")
        monitorAddEvent('Page http://phplaravel-135581-835906.cloudwaysapps.com loaded');

```

Contribution
------------

[](#contribution)

[![Buy Me A Coffee](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/ZArpFcduz)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

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

Total

26

Last Release

2370d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b10013551d1397b91518605600c2d4a1e23d4be8883486da47a0ee81d849e40?d=identicon)[Orinoko](/maintainers/Orinoko)

---

Top Contributors

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

---

Tags

analysisexceptionslaravelmonitoringlaravelexceptionsanalysismonitor

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90234.6M36](/packages/bugsnag-bugsnag-laravel)[tylercd100/lern

LERN (Laravel Exception Recorder and Notifier) is a Laravel 5 package that will record exceptions into a database and will notify you via Email, Pushover or Slack.

438153.4k3](/packages/tylercd100-lern)[cerbero/exception-handler

Extend Laravel exception handler to define how to handle custom exceptions via service providers.

607.5k](/packages/cerbero-exception-handler)[asamir/laravel-in-db-performance-monitor

Monitor your laravel application performance by logging requests in your database then analyze it. The log includes request parameters, actions, SQL queries and errors beside that you can know the requests with raw SQL queries.

216.6k](/packages/asamir-laravel-in-db-performance-monitor)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[rigor789/airbrake-laravel

Laravel package for the Airbrake API, which supports Errbit

1636.5k](/packages/rigor789-airbrake-laravel)

PHPackages © 2026

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