chore: add diagnostic logging for debug mode verification
This temporary logging will help verify that: - EnvironmentType is correctly detected as STAGING - isDebugEnabled() returns false for STAGING - ResponseErrorRenderer receives isDebugMode=false Remove after verification is complete.
This commit is contained in:
@@ -35,6 +35,8 @@ final readonly class ExceptionHandlingInitializer
|
|||||||
?Logger $logger = null
|
?Logger $logger = null
|
||||||
): void {
|
): void {
|
||||||
$isDebugMode = $environmentType->isDebugEnabled();
|
$isDebugMode = $environmentType->isDebugEnabled();
|
||||||
|
// DIAGNOSTIC: Log debug mode determination (remove after verification)
|
||||||
|
error_log("[ExceptionHandlingInitializer] environmentType={$environmentType->value}, isDebugEnabled={$isDebugMode}");
|
||||||
|
|
||||||
// ConsoleOutput - only create if CLI context and not already provided
|
// ConsoleOutput - only create if CLI context and not already provided
|
||||||
// For HTTP context, null is acceptable (ConsoleErrorRenderer won't be used)
|
// For HTTP context, null is acceptable (ConsoleErrorRenderer won't be used)
|
||||||
|
|||||||
@@ -278,6 +278,9 @@ final readonly class ResponseErrorRenderer implements ErrorRenderer
|
|||||||
);
|
);
|
||||||
|
|
||||||
$debugInfo = '';
|
$debugInfo = '';
|
||||||
|
// SECURITY FIX: Only show debug info in development mode
|
||||||
|
// Log to error_log for diagnostic purposes (can be removed after verification)
|
||||||
|
error_log("[ResponseErrorRenderer] isDebugMode={$this->isDebugMode}, APP_ENV=" . ($_ENV['APP_ENV'] ?? 'unknown'));
|
||||||
if ($this->isDebugMode) {
|
if ($this->isDebugMode) {
|
||||||
$debugInfo = $this->generateDebugSection($exception, $contextProvider);
|
$debugInfo = $this->generateDebugSection($exception, $contextProvider);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user