Commit 8f84e0a7 authored by Per von Zweigbergk's avatar Per von Zweigbergk

(BaseModel) Always log the class where validation failed

parent 0441cf4c
...@@ -460,9 +460,10 @@ abstract class BaseModel ...@@ -460,9 +460,10 @@ abstract class BaseModel
if ($messages->count() > 0) { if ($messages->count() > 0) {
$exception_msg = ""; $exception_msg = "";
foreach ($messages as $msg) { foreach ($messages as $msg) {
$exception_msg .= "[".$msg-> getField()."] ".$msg->getMessage()."\n"; $exception_msg_part = "[".str_replace("\\", ".", get_class($this)).".".$msg-> getField(). "] " .$msg->getMessage();
$exception_msg .= "$exception_msg_part\n";
// always log validation errors // always log validation errors
$logger->error(str_replace("\\", ".", get_class($this)).".".$msg-> getField(). " " .$msg->getMessage()); $logger->error($exception_msg_part);
} }
if (!$disable_validation) { if (!$disable_validation) {
throw new \Phalcon\Validation\Exception($exception_msg); throw new \Phalcon\Validation\Exception($exception_msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment