New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

devitek/laravel-correlational-id

A package to add Correlational ID to Laravel
21
Install
composer require devitek/laravel-correlational-id
Latest Version:1.0.2
Laravel:5
License:MIT
Last Updated:Aug 14, 2016
Links: GitHub  ·  Packagist
Maintainer: CaporalDead

Add Correlational ID capability to Laravel

Latest Stable Version Total Downloads Latest Unstable Version License

Installing

composer require devitek/laravel-correlational-id

Add support to HTTP messages

Add this line to your app/Kernel.php file :

<?php

// ...

    protected $middleware = [
        CheckForMaintenanceMode::class,
        CorrelationalId::class,
        // ...
    ];

// ...

Add processor to Monolog

Add this line to your app/Kernel.php file :

<?php

// ...

    protected $middleware = [
        CheckForMaintenanceMode::class,
        CorrelationalId::class,
        CorrelationalIdMonolog::class,
        // ...
    ];

// ...

Add tag context to Sentry

Add this line to your app/Kernel.php file :

<?php

// ...

    protected $middleware = [
        CheckForMaintenanceMode::class,
        CorrelationalId::class,
        CorrelationalIdSentry::class,
        // ...
    ];

// ...

How it works ?

HTTP message

When your app receive an HTTP message it will try to read the X-Correlational-Id header from the request or generate a new one and add the same one to the response. It will also attach it as a request attribute.

Monolog

It will try to get the correlational ID from the request attributes and push a processor into monolog.

Sentry

It will try to get the correlational ID from the request attributes and add a tag context to the sentry client.

Enjoy it ! Feel free to fork :) !

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

665,354,487 9,703
laravel/framework

The Laravel Framework.

633,434,998 35,124
laravel/tinker

Powerful REPL for the Laravel framework.

539,265,140 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

458,029,405 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662

Version History

Version Released Laravel License
1.0.2 ^5.2 MIT
1.0.1 ^5.2 MIT
1.0.0 ^5.0 MIT