From eeb08bc563a11335156277fbcc33b9807622df4b Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 7 Jul 2026 13:28:10 -0400 Subject: [PATCH] Enhance account tracing functionality and error handling in inc_fx_trace_compte.php This commit updates the account tracing logic by adding a check for both development and pre-production environments to determine if tracing is enabled. Additionally, it introduces a fallback error logging mechanism to capture log entries when the log file is not writable, improving the robustness of the tracing functionality. These changes aim to enhance debugging capabilities and ensure reliable logging in various environments. --- php/inc_fx_trace_compte.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php/inc_fx_trace_compte.php b/php/inc_fx_trace_compte.php index 0814848..807655e 100644 --- a/php/inc_fx_trace_compte.php +++ b/php/inc_fx_trace_compte.php @@ -13,9 +13,9 @@ function fxTraceCompteEnabled() return $blnEnabled; } - global $vblnEnvironementDev; + global $vblnEnvironementDev, $vblnEnvironementPreProd; - if (empty($vblnEnvironementDev)) { + if (empty($vblnEnvironementDev) && empty($vblnEnvironementPreProd)) { $blnEnabled = false; return false; } @@ -57,6 +57,11 @@ function fxTraceCompte($strStep, $arrExtra = array()) } @file_put_contents($strDir . '/compte-trace.log', $strLine, FILE_APPEND | LOCK_EX); + + // Secours si le dossier logs n'est pas inscriptible (permissions serveur). + if (!is_file($strDir . '/compte-trace.log')) { + @error_log('compte-trace: ' . trim($strLine)); + } } /** Appeler juste avant header('Location:…'); exit; */