I came here with the same question and I fixed it by creating a new ServiceProvider and in there I've added:
$uuid = Uuid::uuid();
$monolog = Log::getMonolog();
$monolog->pushProcessor(function ($record) use ($uuid) {
$record['extra']['request-id'] = $uuid;
$record['extra']['user'] = (Auth::user() ? Auth::user()->id : null);
$record['extra']['ip'] = \Request::getClientIp();
return $record;
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community