PHPackages                             noartem/laravel-wide-events - 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. noartem/laravel-wide-events

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

noartem/laravel-wide-events
===========================

Wide Events for Laravel.

v0.0.1(4mo ago)21MITPHPPHP ^8.1

Since Dec 31Pushed 4mo agoCompare

[ Source](https://github.com/noartem/laravel-wide-events)[ Packagist](https://packagist.org/packages/noartem/laravel-wide-events)[ Docs](https://github.com/noartem/laravel-wide-events)[ RSS](/packages/noartem-laravel-wide-events/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Wide Events
===================

[](#laravel-wide-events)

This package implements **wide events**: build one structured event per request, enrich it throughout the request lifecycle, then **emit once at the end** with **tail sampling**.

More about wide events and why traditional logging suck you can find out at [loggingsucks.com](http://loggingsucks.com/).

Quick start
-----------

[](#quick-start)

1. Install [package](https://packagist.org/packages/noartem/laravel-wide-events)

```
composer require noartem/laravel-wide-events
php artisan vendor:publish --tag=wide-events-config
```

2. Register middleware (early in the stack)

```
// bootstrap/app.php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->append(\Noartem\LaravelWideEvents\Http\Middleware\InitWideEvent::class);
        // ... other middlewares
    })
    ->create();
```

If you are still using `app/Http/Kernel.php`, add the middleware to `$middleware` there instead.

3. Enrich anywhere in code

```
use Illuminate\Support\Facades\Log;

Log::wideEvent('user.id', auth()->id());
Log::wideEvent('cart.total_cents', 12345);
```

4. Customize sampling

```
// config/wide-events.php
'sampler' => App\Logging\CustomWideEventSampler::class,
```

Your class must implement [WideEventSampler](./src/Contracts/WideEventSampler.php). Or extend default implementation: [DefaultWideEventSampler](./src/Samplers/DefaultWideEventSampler.php). More examples of samplers in [examples/](./examples/).

Custom collectors
-----------------

[](#custom-collectors)

Register extra collectors in config:

```
// config/wide-events.php
'collectors' => [
    App\Logging\CheckoutCollector::class,
],
```

A collector should extend the base class and map events to handlers:

```
use Noartem\LaravelWideEvents\Collectors\BaseCollector;
use Illuminate\Routing\Events\RouteMatched;

final class CheckoutCollector extends BaseCollector
{
    public function events(): array
    {
        return [RouteMatched::class => 'onRoute'];
    }

    public function onRoute(RouteMatched $event): void
    {
        $this->put('route.name', $event->route->getName());
    }
}
```

Default sampling behavior
-------------------------

[](#default-sampling-behavior)

By default the sampler keeps:

- all requests with exceptions or 5xx
- requests slower than the configured percentile of recent durations
- a deterministic sample of the rest

Sanitization
------------

[](#sanitization)

Redaction is applied by key and value patterns. Update `wide-events.redaction` in the config to add your own key names or regexes for sensitive values (Stripe, GitHub, JWT, etc).

Output format
-------------

[](#output-format)

A single log record:

- message: `wide_event` (configurable)
- context: the wide event payload (array)

Use a JSON formatter on the chosen channel for best results.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance76

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27d626b9ada5ae9b1e66317e839df0492d9cb2cc507afd76d60639f2b0250927?d=identicon)[noartem](/maintainers/noartem)

---

Top Contributors

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

---

Tags

laravelloggingwide-eventslaravelloggingeventstelemetryobservability

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/noartem-laravel-wide-events/health.svg)

```
[![Health](https://phpackages.com/badges/noartem-laravel-wide-events/health.svg)](https://phpackages.com/packages/noartem-laravel-wide-events)
```

###  Alternatives

[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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