devitek / laravel-correlational-id
A package to add Correlational ID to Laravel
1.0.2
2016-08-14 20:36 UTC
Requires
- illuminate/contracts: ^5.2
- illuminate/http: ^5.2
- illuminate/log: ^5.2
- ramsey/uuid: ^3.4
- sentry/sentry-laravel: ^0.3.0
This package is auto-updated.
Last update: 2024-11-24 02:52:33 UTC
README
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 :) !