From 5d9b47f4576a15850c7a0cae9b1939343813740a Mon Sep 17 00:00:00 2001 From: "lorenzo.padovani@padosoft.com" Date: Tue, 10 Jan 2023 11:03:06 +0100 Subject: [PATCH] =?UTF-8?q?Migliorata=20la=20stampa=20dell'errore=20in=20c?= =?UTF-8?q?aso=20di=20validazione=20errata=20con=20tutti=20gli=20attributi?= =?UTF-8?q?=20del=20model=20prima=20faceva=20tante=20entry=20nel=20log=20a?= =?UTF-8?q?desso=20un=20unica=20entry=20che=20con=20sistemi=20tipo=20logVi?= =?UTF-8?q?ewer=20si=20legge=20meglio=20e=20se=20mandiamo=20ad=20un=20serv?= =?UTF-8?q?izio=20in=20cloud=20conta=20una=20sola=20request=20anzich=C3=A8?= =?UTF-8?q?=20n=20request.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Validable.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Validable.php b/src/Validable.php index 1b94d2e..7c97851 100644 --- a/src/Validable.php +++ b/src/Validable.php @@ -68,17 +68,18 @@ public function validate() $this->setErrors($v->messages()); if (config('laravel-validable.debug')) { - Log::debug('Errore durante la validazione del model \'' . $this->getTable() . '\' in \'' . ($this->id > 0 ? 'update' : 'create') . '\' lanciato su evento saving del model.'); - Log::debug('Attributi del model:'); - Log::debug($this->toJson(JSON_PRETTY_PRINT)); - Log::debug('Errori di validazione:'); - Log::debug($this->getErrors()); - Log::debug('StackTrace:'.PHP_EOL); + $msg = 'Errore durante la validazione del model \'' . $this->getTable() . '\' in \'' . ($this->id > 0 ? 'update' : 'create') . '\' lanciato su evento saving del model.'; + $msg .= 'Attributi del model:'; + $msg .= $this->toJson(JSON_PRETTY_PRINT); + $msg .= 'Errori di validazione:'; + $msg .= $this->getErrors(); + $msg .= 'StackTrace:'.PHP_EOL; ob_start(); debug_print_backtrace(); $StackTrace = ob_get_contents(); ob_end_clean(); - Log::debug($StackTrace); + $msg .= $StackTrace; + Log::debug($msg); } return false;