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:
2025-10-27 22:23:18 +01:00
parent e326e3d6c6
commit 70e45fb56e
56 changed files with 1519 additions and 355 deletions

View File

@@ -37,7 +37,7 @@ final readonly class ErrorEvent
/**
* Creates ErrorEvent from ErrorHandlerContext
*/
public static function fromErrorHandlerContext(ErrorHandlerContext $context, \App\Framework\DateTime\Clock $clock): self
public static function fromErrorHandlerContext(ErrorHandlerContext $context, \App\Framework\DateTime\Clock $clock, bool $isDebug = false): self
{
return new self(
id: new Ulid($clock),
@@ -54,7 +54,7 @@ final readonly class ErrorEvent
userId: $context->request->userId ?? null,
clientIp: $context->request->clientIp,
isSecurityEvent: $context->exception->metadata['security_event'] ?? false,
stackTrace: self::extractStackTrace($context),
stackTrace: self::extractStackTrace($context, $isDebug),
userAgent: $context->request->userAgent,
);
}
@@ -263,10 +263,10 @@ final readonly class ErrorEvent
};
}
private static function extractStackTrace(ErrorHandlerContext $context): ?string
private static function extractStackTrace(ErrorHandlerContext $context, bool $isDebug = false): ?string
{
// Don't include stack traces for security events in production
if (($context->exception->metadata['security_event'] ?? false) && ! ($_ENV['APP_DEBUG'] ?? false)) {
if (($context->exception->metadata['security_event'] ?? false) && ! $isDebug) {
return null;
}