Download the PHP package khodja/laravel-observer without Composer

On this page you can find all versions of the php package khodja/laravel-observer. 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 laravel-observer

khodja/laravel-observer

Laravel client package for the Log Observer server. Applications keep using Log::info(), Log::error(), report($e); this package adds a Monolog handler that buffers records in memory and ships them to the Log Server in batches. The package supports Laravel 10 through 13 and PHP 8.1 or newer.

Install

The package is available on Packagist:

Source: FayzullaKhodja/laravel-observer.

For local development against a checkout of the monorepo, use a path repository ("type": "path", "url": "../log-observer/packages/laravel-observer") and composer require khodja/laravel-observer:@dev instead.

Package discovery registers ObserverServiceProvider automatically.

Configure logging

Add an observer channel to config/logging.php, then keep it next to a local channel in the normal Laravel stack:

Do not replace the local daily channel. Application code continues to use Laravel's standard logger:

Environment

OBSERVER_APP_NAME defaults to APP_NAME. The optional OBSERVER_REDACT_KEYS value is a comma-separated list of sensitive key fragments.

Request and job correlation

By default, the package prepends global HTTP middleware that accepts an X-Request-ID containing 1 to 128 letters, digits, ., _, :, or -. It generates a ULID when that header is absent or invalid, adds the ID to all observer and local Laravel logs, and returns it on the response. Set OBSERVER_REQUEST_ID_MIDDLEWARE=false to disable this behavior or change the header with OBSERVER_REQUEST_ID_HEADER.

Observer records include the request method, query-redacted path, route name, and only an already-resolved authenticated user ID. Bodies, headers, cookies, IP addresses, and user profile fields are not collected. On Laravel 11 and newer, Laravel Context automatically carries the request ID into jobs dispatched during the request. Laravel 10 has no Context dehydration, so request IDs are not propagated into queued jobs automatically. Request and local-log correlation still work on Laravel 10, and records produced while any job runs still contain its resolved name and queue under context._job.

Exception capture

Exceptions reported through Laravel's normal report($e) flow, unhandled exceptions, and throwable values passed as context['exception'] are captured without a package-specific API. The observer record includes the exception class, message, code, file, line, and an argument-free stack trace. Previous exceptions are included up to five levels deep.

Exception messages use OBSERVER_MAX_MESSAGE_LENGTH. Stack traces are limited by OBSERVER_MAX_TRACE_LENGTH (32,768 characters by default) and marked when truncated. The extracted throwable is removed from context; other exception context supplied through Laravel is normalized and redacted as usual.

Limits and delivery behavior

Records are normalized, recursively redacted, and held in memory. The package sends one batch when the application terminates or a queue job/console command finishes. When OBSERVER_MAX_BATCH_RECORDS or OBSERVER_MAX_BATCH_BYTES is reached, it sends that full batch early and continues with a fresh buffer so long workers stay bounded. A single record whose JSON-encoded size exceeds max(1, OBSERVER_MAX_BATCH_BYTES) is dropped before buffering and is never sent. The drop is silent to avoid recursive Laravel logging. The byte limit leaves room under the server's default 2 MB request limit for the envelope.

Delivery uses short connect/request timeouts, no retries, and no persistent client queue. Failed deliveries and non-success responses are dropped without affecting application code. Logging during delivery is ignored to prevent recursive observer requests. Setting OBSERVER_ENABLED=false, or omitting the URL or token, makes the handler a no-op.

License

MIT. See LICENSE.


All versions of laravel-observer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/log Version ^10.0|^11.0|^12.0|^13.0
monolog/monolog Version ^3.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 khodja/laravel-observer contains the following files

Loading the files please wait ...