Download the PHP package kirschbaum-development/monitor without Composer

On this page you can find all versions of the php package kirschbaum-development/monitor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package monitor

Laravel Monitor

Laravel Supported Versions Latest Version on Packagist Application Testing Static Analysis Code Style

Laravel Monitor is an observability helper / toolkit for Laravel applications.

This package is active development and its API can change abruptly without any notice. Please reach out if you plan to use it in a production environment.

Table of Contents

Installation

Install via Composer:

Publish configuration files:

Components

Structured Logging

What it does: Enhances Laravel's logging with automatic enrichment (trace IDs, timing, memory usage, structured context) and smart origin resolution from class namespaces.

Note: While you can override with Monitor::log('CustomName'), using log($this) is preferred as it automatically provides meaningful, consistent origin tracking from your actual class structure.

What it logs:

Note: The event field uses the raw origin name (after path replacers but before wrapper), while the message field uses the wrapped origin name for readability.

Configuration: Origin path replacers, separators, and wrappers control how class names appear in logs:

Controlled Execution Blocks

What it does: Monitors critical operations with automatic start/end logging, exception-specific handling, DB transactions, circuit breakers, and true escalation for uncaught exceptions.

Note: The second parameter $origin (usually $this) is optional and automatically provides origin context to the structured logger used by the controlled block, eliminating the need for a separate ->log() call.

Factory & Execution

Context Management

Exception Handling

Exception-Specific Handlers (catching):

Uncaught Exception Handling (onUncaughtException):

Key Behavior:

Circuit Breaker & Database Protection

What are Circuit Breakers? Circuit breakers prevent cascading failures by temporarily stopping requests to a failing service, allowing it time to recover. They automatically "open" after a threshold of failures and "close" once the service is healthy again, protecting your application from wasting resources on operations likely to fail.

Circuit Breaker HTTP Middleware

You can also protect entire routes or route groups using the CheckCircuitBreakers middleware:

Circuit Breaker Middleware Features:

Response Headers When Circuit is Open:

The Retry-After header includes intelligent jitter - instead of all clients retrying at the exact same time, it provides a random delay between 0 and the remaining decay time, preventing overwhelming the recovering service.

Tracing & Logging

Complete Example

What it logs:

Success:

Caught Exception (Recovery):

Uncaught Exception (Escalation):

API Reference

Method Purpose Returns
Monitor::controlled(string $name, string\|object $origin = null) Create controlled block with optional origin self
->overrideContext(array $context) Replace entire context self
->addContext(array $context) Merge additional context self
->catching(array $handlers) Define exception-specific handlers self
->onUncaughtException(Closure $callback) Handle uncaught exceptions only self
->withCircuitBreaker(string $name, int $threshold, int $decay) Configure circuit breaker self
->withDatabaseTransaction(int $retries, array $only, array $exclude) Wrap in DB transaction with retry self
->overrideTraceId(string $traceId) Set custom trace ID self
->run(Closure $callback) Execute the controlled block mixed

Distributed Tracing

What it does: Provides correlation IDs that follow requests across services, jobs, and operations.

Trace Management:

Key Differences:

HTTP Middleware

What it does: Automatically manages trace IDs for HTTP requests, enabling seamless distributed tracing across services.

Registration:

Behavior:

Cross-service usage:

Configuration: Custom header name via trace_header config or MONITOR_TRACE_HEADER env var.

Performance Timing

What it does: Provides millisecond-precision timing for operations.

Note: All Monitor logging automatically includes duration_ms from service start.

Circuit Breaker Direct Access

What it does: Provides direct access to circuit breaker state management for advanced use cases.

Usage in Custom Logic:

Log Redactor Direct Access

What it does: Provides direct access to the redactor for custom redaction needs.

Log Redaction

What it does: Automatically scrubs sensitive data from log context using Kirschbaum Redactor to ensure compliance and security while preserving important data.

Configuration: Simple redaction configuration in config/monitor.php:

Usage: Redaction is automatically applied to all Monitor log context:

For detailed redaction configuration, rules, patterns, and profiles, see the Kirschbaum Redactor documentation.

Complete API Reference

The Monitor facade provides access to all monitoring components:

All components integrate seamlessly and share trace context automatically when used together.

Configuration

Environment Variables:

Logging Channel: Configure a dedicated Monitor logging channel:

Output Examples

Structured Log Entry:

Controlled Block Execution:

Failure with Exception:

Testing

Run the test suite:

License

The MIT License (MIT). Please see License File for more information.


All versions of monitor with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^11.9|^12.0
spatie/laravel-package-tools Version ^1.16
php Version ^8.3|^8.4
kirschbaum-development/redactor Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kirschbaum-development/monitor contains the following files

Loading the files please wait ....