Replies: 1 comment
-
hey @Mrlaminat , so I don't know how to implement this actually, so that it would work for all Log Viewer users. But here's what I do at work: public function handle($request, $next)
{
Log::withContext([
'request_id' => Str::uuid(),
'user_id' => $request->user()?->id,
'request_uri' => $request->method() . ' ' . $request->url(),
]);
return $next($request);
} and with that, any further logs would automatically include this context. The So once you have this context in all your logs, then finding related entries is as easy as searching for that request ID. Now we can't make this behaviour default in Log Viewer, because not everyone wants to log this information, or even in that specific way. And to make this work we also need custom middlewares, maybe even a middleware for queued jobs to identify those as well, and maybe more. |
Beta Was this translation helpful? Give feedback.
-
After filtering and finding a specific log message, we should also have the ability to view the surrounding log messages from the same page. This can be particularly useful for context when you're debugging or reviewing logs.
From the simple implementation, it could be the button near "Link to this log entry", which will lead to the page=%, where this log occurred.
What do you think about it? If there is any way that we can implement\extend the current functionality, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions