diff --git a/lib/classes/module/console/schedulerStart.class.php b/lib/classes/module/console/schedulerStart.class.php index 22876c6c27..cf824beccc 100644 --- a/lib/classes/module/console/schedulerStart.class.php +++ b/lib/classes/module/console/schedulerStart.class.php @@ -43,11 +43,11 @@ class module_console_schedulerStart extends Command $logger = new Logger('Task logger'); - $handler = new Handler\StreamHandler(fopen('php://stdout'), $input->getOption('verbose') ? Logger::DEBUG : Logger::WARNING); + $handler = new Handler\StreamHandler(fopen('php://stdout', 'a'), $input->getOption('verbose') ? Logger::DEBUG : Logger::WARNING); $logger->pushHandler($handler); - $logfile = __DIR__ . '/../../../../scheduler.log'; - $handler = new Handler\RotatingFileHandler($logfile, 10, $level = Logger::WARNING); + $logfile = __DIR__ . '/../../../../logs/scheduler.log'; + $handler = new Handler\RotatingFileHandler($logfile, 10); $logger->pushHandler($handler); try { diff --git a/lib/classes/module/console/taskrun.class.php b/lib/classes/module/console/taskrun.class.php index ab2169016c..4f3b7e0cab 100755 --- a/lib/classes/module/console/taskrun.class.php +++ b/lib/classes/module/console/taskrun.class.php @@ -104,8 +104,8 @@ class module_console_taskrun extends Command $logger->pushHandler($handler); } - $logfile = __DIR__ . '/../../../../task_l_' . $task_id . '.log'; - $handler = new Handler\RotatingFileHandler($logfile, 10, $level = Logger::WARNING); + $logfile = __DIR__ . '/../../../../logs/task_' . $task_id . '.log'; + $handler = new Handler\RotatingFileHandler($logfile, 10); $logger->pushHandler($handler); $this->task = $task_manager->getTask($task_id, $logger); diff --git a/lib/classes/task/Scheduler.class.php b/lib/classes/task/Scheduler.class.php index ec20693bfb..177ed370bd 100755 --- a/lib/classes/task/Scheduler.class.php +++ b/lib/classes/task/Scheduler.class.php @@ -213,27 +213,20 @@ class task_Scheduler if ( ! isset($taskPoll[$tkey])) { // the task is not in the poll, add it - $phpcli = $registry->get('GV_cli'); - switch ($system) { - case "WINDOWS": - $cmd = $phpcli; - $args = array('-f', $registry->get('GV_RootPath') . 'bin/console', '--', '-q', 'task:run', $task->getID(), '--runner=scheduler'); - break; - default: - case "DARWIN": - case "LINUX": - $cmd = $phpcli; - $args = array('-f', $registry->get('GV_RootPath') . 'bin/console', '--', '-q', 'task:run', $task->getID(), '--runner=scheduler'); - break; - } - $taskPoll[$tkey] = array( "task" => $task, "current_status" => $status, - "cmd" => $cmd, - "args" => $args, - "killat" => null, - "sigterm_sent" => false + "cmd" => $registry->get('GV_cli'), + "args" => array( + '-f', + $registry->get('GV_RootPath') . 'bin/console', + '--', + '-q', + 'task:run', + $task->getID(), '--runner=scheduler' + ), + "killat" => null, + "sigterm_sent" => false ); if ($this->method == self::METHOD_PROC_OPEN) { $taskPoll[$tkey]['process'] = NULL; diff --git a/www/admin/showlogtask.php b/www/admin/showlogtask.php index 61420e7f0d..f87530e111 100644 --- a/www/admin/showlogtask.php +++ b/www/admin/showlogtask.php @@ -8,6 +8,8 @@ * file that was distributed with this source code. */ +use Symfony\Component\Finder\Finder; + /** * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 @@ -19,7 +21,7 @@ $appbox = appbox::get_instance($Core); $session = $appbox->get_session(); $request = http_request::getInstance(); -$parm = $request->get_parms('fil', 'log', 'id', 'act'); +$parm = $request->get_parms('fil', 'id', 'act'); ?>
@@ -33,53 +35,49 @@ $parm = $request->get_parms('fil', 'log', 'id', 'act'); -\n"); - print(htmlentities(file_get_contents($logfile))); + print(htmlentities(file_get_contents($file->getRealPath()))); print("\n"); } - } else { - printf("