Fixed bug #12565: Scheduler: Added option to turn off logging, which could be too...
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / class.tx_scheduler_task.php
index 96aa76b..630d782 100755 (executable)
@@ -374,17 +374,11 @@ abstract class tx_scheduler_Task {
 
                                if ($failure instanceof Exception) {
                                                // Log failed execution
 
                                if ($failure instanceof Exception) {
                                                // Log failed execution
-                                       $GLOBALS['BE_USER']->writelog(
-                                               4,
-                                               0,
-                                               1,
-                                               $failure->getCode(),
-                                               '[scheduler]: Task failed to execute successfully. Class: '
+                                       $logMessage = 'Task failed to execute successfully. Class: '
                                                        . get_class($this) . ', UID: '
                                                        . $this->taskUid . '. '
                                                        . get_class($this) . ', UID: '
                                                        . $this->taskUid . '. '
-                                                       . $failure->getMessage(),
-                                               array()
-                                       );
+                                                       . $failure->getMessage();
+                                       $this->scheduler->log($logMessage, 1, $failure->getCode());
 
                                        $failure = serialize($failure);
                                } else {
 
                                        $failure = serialize($failure);
                                } else {