Log 404 errors and update RDAP server route
Added logging for 404 errors in Router.php to aid debugging, capturing request details. Renamed the RDAP server update route in web.php from 'update-rdap-server' to 'update-rdap-servers' to match controller method.
This commit is contained in:
@@ -56,6 +56,22 @@ class Router
|
|||||||
|
|
||||||
if ($callback === null) {
|
if ($callback === null) {
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
|
|
||||||
|
// Log 404 errors for debugging
|
||||||
|
try {
|
||||||
|
$logger = new \App\Services\Logger('router');
|
||||||
|
$logger->warning('404 Not Found', [
|
||||||
|
'path' => $path,
|
||||||
|
'method' => $method,
|
||||||
|
'ip_address' => $_SERVER['REMOTE_ADDR'] ?? 'unknown',
|
||||||
|
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? 'unknown',
|
||||||
|
'referer' => $_SERVER['HTTP_REFERER'] ?? null,
|
||||||
|
'user_id' => $_SESSION['user_id'] ?? null
|
||||||
|
]);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// Silently fail if logging is not available
|
||||||
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/../app/Views/errors/404.php';
|
require_once __DIR__ . '/../app/Views/errors/404.php';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ $router->get('/tld-registry/check-updates', [TldRegistryController::class, 'chec
|
|||||||
$router->get('/tld-registry/{id}/toggle-active', [TldRegistryController::class, 'toggleActive']);
|
$router->get('/tld-registry/{id}/toggle-active', [TldRegistryController::class, 'toggleActive']);
|
||||||
$router->get('/tld-registry/{id}/refresh', [TldRegistryController::class, 'refresh']);
|
$router->get('/tld-registry/{id}/refresh', [TldRegistryController::class, 'refresh']);
|
||||||
$router->post('/tld-registry/{id}/update-whois-server', [TldRegistryController::class, 'updateWhoisServer']);
|
$router->post('/tld-registry/{id}/update-whois-server', [TldRegistryController::class, 'updateWhoisServer']);
|
||||||
$router->post('/tld-registry/{id}/update-rdap-server', [TldRegistryController::class, 'updateRdapServer']);
|
$router->post('/tld-registry/{id}/update-rdap-servers', [TldRegistryController::class, 'updateRdapServers']);
|
||||||
$router->get('/tld-registry/import-logs', [TldRegistryController::class, 'importLogs']);
|
$router->get('/tld-registry/import-logs', [TldRegistryController::class, 'importLogs']);
|
||||||
$router->get('/api/tld-info', [TldRegistryController::class, 'apiGetTldInfo']);
|
$router->get('/api/tld-info', [TldRegistryController::class, 'apiGetTldInfo']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user