From ada0434caff6edc3ba104493c7274bcfd92af39c Mon Sep 17 00:00:00 2001 From: Aldarien Date: Thu, 19 Oct 2023 19:10:08 -0300 Subject: [PATCH] Error log cuotas --- app/src/Controller/API/Ventas/Cuotas.php | 6 ++++++ php-errors.ini | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/Controller/API/Ventas/Cuotas.php b/app/src/Controller/API/Ventas/Cuotas.php index f47b94e..25a8545 100644 --- a/app/src/Controller/API/Ventas/Cuotas.php +++ b/app/src/Controller/API/Ventas/Cuotas.php @@ -37,7 +37,11 @@ class Cuotas { $output = []; try { + $benchmark = [ + 'start' => microtime(true) + ]; $cuotas = $cuotaRepository->fetchDatosPorVencer(); + $benchmark['cuotas'] = microtime(true) - $benchmark['start']; foreach ($cuotas as $row) { $fecha = $row['Fecha']; $date = new DateTimeImmutable($fecha); @@ -61,6 +65,8 @@ class Cuotas }); $output[$key] = $day; } + $benchmark['run'] = microtime(true) - $benchmark['start']; + error_log(var_export($benchmark,true)); } catch (EmptyResult) {} return $this->withJson($response, ['cuotas' => $output]); } diff --git a/php-errors.ini b/php-errors.ini index c791df7..aed1ffb 100644 --- a/php-errors.ini +++ b/php-errors.ini @@ -1,3 +1,3 @@ display_errors=no log_errors=yes -error_log=/logs/php_errors.log +error_log=/logs/errors.log