diff --git a/webfiori/framework/scheduler/AbstractTask.php b/webfiori/framework/scheduler/AbstractTask.php index 9d81ed8c..acbf478f 100644 --- a/webfiori/framework/scheduler/AbstractTask.php +++ b/webfiori/framework/scheduler/AbstractTask.php @@ -13,6 +13,7 @@ use Exception; use Throwable; use webfiori\collections\Queue; +use webfiori\error\TraceEntry; use webfiori\framework\cli\commands\SchedulerCommand; use webfiori\framework\exceptions\InvalidCRONExprException; use webfiori\framework\Util; @@ -1504,9 +1505,15 @@ private function logExeException(Throwable $ex, string $meth = '') { TasksManager::log('Exception message: '.$ex->getMessage()); TasksManager::log('Thrown in: '.Util::extractClassName($ex->getFile())); TasksManager::log('Line: '.$ex->getLine()); - TasksManager::log("Stack Trace:"); - TasksManager::log($ex->getTraceAsString()); - + TasksManager::log('Stack Trace:'); + $index = 0; + + foreach ($ex->getTrace() as $traceEntry) { + $e = new TraceEntry($traceEntry); + TasksManager::log('#'.$index.' '.$e); + $index++; + } + if ($meth == 'execute') { $this->isSuccess = false; }