Monolog processor for microservices to append correlation id to log messages.
It's very difficult to track a request accross the system when we are working with microservices. We came out a solution for that. We generate a unique version 4 uuid for every request and every service passes this id via request header to other services. We call this correlation ID.
- Middleware for Laravel and Lumen frameworks.
- Middleware for any PSR-7 compatible frameworks like Slim Framework.
- Monolog processor for correlate middlewares (you don't have to use this directly).
- Guzzle middleware to add correlation id to every requests.
- Common package for correlate id middlewares to provide consistent header naming accross projects.
You should not use this directly.
By the way if you want to use it directly, you can install it via composer.
$ composer require proemergotech/correlate-php-monolog
Generate a correlation id:
$processor = new \ProEmergotech\Correlate\Monolog\CorrelateProcessor('x_correlation_id', $correlationId); $monolog->pushProcessor($processor);
This project is released under the MIT License.