feat: Inertia profile settings page, Studio edit redesign, EGS, Nova UI components\n\n- Redesign /dashboard/profile as Inertia React page (Settings/ProfileEdit)\n with SettingsLayout sidebar, Nova UI components (TextInput, Textarea,\n Toggle, Select, RadioGroup, Modal, Button), avatar drag-and-drop,\n password change, and account deletion sections\n- Redesign Studio artwork edit page with two-column layout, Nova components,\n integrated TagPicker, and version history modal\n- Add shared MarkdownEditor component\n- Add Early-Stage Growth System (EGS): SpotlightEngine, FeedBlender,\n GridFiller, AdaptiveTimeWindow, ActivityLayer, admin panel\n- Fix upload category/tag persistence (V1+V2 paths)\n- Fix tag source enum, category tree display, binding resolution\n- Add settings.jsx Vite entry, settings.blade.php wrapper\n- Update ProfileController with JSON response support for API calls\n- Various route fixes (profile.edit, toolbar settings link)"
This commit is contained in:
59
app/Services/NotFoundLogger.php
Normal file
59
app/Services/NotFoundLogger.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* NotFoundLogger
|
||||
*
|
||||
* Logs 404 and 500 error events to dedicated log channels so they can
|
||||
* be tracked, aggregated and used to create redirect rules later.
|
||||
*
|
||||
* 404 → logged to 'not_found' channel (see config/logging.php daily driver)
|
||||
* 500 → logged to default channel with correlation ID
|
||||
*/
|
||||
final class NotFoundLogger
|
||||
{
|
||||
/**
|
||||
* Log a 404 hit: URL, referrer, user-agent, user ID.
|
||||
*/
|
||||
public function log404(Request $request): void
|
||||
{
|
||||
Log::channel(config('logging.not_found_channel', 'daily'))->info('404 Not Found', [
|
||||
'url' => $request->fullUrl(),
|
||||
'method' => $request->method(),
|
||||
'referrer' => $request->header('Referer') ?? '(direct)',
|
||||
'user_agent' => $request->userAgent(),
|
||||
'user_id' => $request->user()?->id,
|
||||
'ip' => $request->ip(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a 500 server error with a generated correlation ID.
|
||||
* Returns the correlation ID so it can be shown on the error page.
|
||||
*/
|
||||
public function log500(\Throwable $e, Request $request): string
|
||||
{
|
||||
$correlationId = strtoupper(Str::random(8));
|
||||
|
||||
Log::error('500 Server Error [' . $correlationId . ']', [
|
||||
'correlation_id' => $correlationId,
|
||||
'url' => $request->fullUrl(),
|
||||
'method' => $request->method(),
|
||||
'exception' => get_class($e),
|
||||
'message' => $e->getMessage(),
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'user_id' => $request->user()?->id,
|
||||
'ip' => $request->ip(),
|
||||
]);
|
||||
|
||||
return $correlationId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user