New in Laravel 8.49: Log::withContext()
will help you to differentiate the Log messages between different requests.
If you create a Middleware and set this context, all Log messages will contain that context, and you'll be able to search them easier.
1public function handle(Request $request, Closure $next) 2{ 3 $requestId = (string) Str::uuid(); 4 5 Log::withContext(['request-id' => $requestId]); 6 7 $response = $next($request); 8 9 $response->header('request-id', $requestId);10 11 return $response;12}