fix(Discovery): Add comprehensive debug logging for router initialization
- Add initializer count logging in DiscoveryServiceBootstrapper - Add route structure analysis in RouterSetup - Add request parameter logging in HttpRouter - Update PHP production config for better OPcache handling - Fix various config and error handling improvements
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Console\Analytics\Middleware;
|
||||
|
||||
use App\Framework\Config\AppConfig;
|
||||
use App\Framework\Config\Environment;
|
||||
use App\Framework\Console\Analytics\Repository\CommandUsageRepository;
|
||||
use App\Framework\Console\Analytics\ValueObjects\CommandUsageMetric;
|
||||
use App\Framework\Console\ExitCode;
|
||||
@@ -17,6 +19,8 @@ final readonly class AnalyticsCollectionMiddleware implements ConsoleMiddleware
|
||||
{
|
||||
public function __construct(
|
||||
private CommandUsageRepository $repository,
|
||||
private AppConfig $appConfig,
|
||||
private Environment $environment,
|
||||
private bool $enabled = true
|
||||
) {
|
||||
}
|
||||
@@ -92,7 +96,7 @@ final readonly class AnalyticsCollectionMiddleware implements ConsoleMiddleware
|
||||
{
|
||||
// In a real implementation, this would extract user ID from context
|
||||
// Could be from environment variables, session data, etc.
|
||||
return $_ENV['CONSOLE_USER_ID'] ?? null;
|
||||
return $this->environment->getString('CONSOLE_USER_ID');
|
||||
}
|
||||
|
||||
private function collectMetadata(ConsoleInput $input, ExitCode $exitCode): array
|
||||
@@ -103,13 +107,9 @@ final readonly class AnalyticsCollectionMiddleware implements ConsoleMiddleware
|
||||
'php_version' => PHP_VERSION,
|
||||
'memory_peak' => memory_get_peak_usage(true),
|
||||
'exit_code_name' => $exitCode->name,
|
||||
'environment' => $this->appConfig->type->value,
|
||||
];
|
||||
|
||||
// Add environment context
|
||||
if (isset($_ENV['APP_ENV'])) {
|
||||
$metadata['environment'] = $_ENV['APP_ENV'];
|
||||
}
|
||||
|
||||
// Add process info
|
||||
if (function_exists('posix_getpid')) {
|
||||
$metadata['process_id'] = posix_getpid();
|
||||
|
||||
Reference in New Issue
Block a user