n2n / n2n-monitor
Monitor used for slow query alerts and frontend exceptions handler
v7.4.0
2024-12-04 10:35 UTC
Requires
- n2n/n2n: ~7.4
- n2n/n2n-composer-module-installer: ^7.1.5
- n2n/n2n-impl-web-ui: ^7.4
- n2n/n2n-io: ^7.4
- n2n/n2n-mail: ^7.4
- n2n/n2n-web: ^7.4
Requires (Dev)
- n2n/n2n-test: ^7.4
- phpunit/phpunit: ^9.6.7
This package is auto-updated.
Last update: 2026-06-05 15:33:30 UTC
README
Monitor module for n2n applications.
monitor.js is a clientside js error reporter for n2n.
PHP Setup
use n2n\monitor\ui\MonitorHtmlBuilder; $monitorHtmlBuilder = new MonitorHtmlBuilder($view); $monitorHtmlBuilder->meta()->setup();
This emits:
meta[name="monitor-url"]- the
n2n-monitor/monitor.jsscript
Load monitor.js before other JavaScript code.
JavaScript
Plain JavaScript projects do not need extra setup beyond $monitorHtmlBuilder->meta()->setup().
The script installs:
window.n2nMonitor.report(error)window._n2nMonitorErrorHandler(error)
Angular projects should forward caught Angular errors to window.n2nMonitor.report(error).
Payload
Reports are POSTed as JSON to the URL from meta[name="monitor-url"].
Payload fields:
discriminatorseveritynamemessagestackTraceurl