Controller/DefaultController.php
public function fileAction($id, $type)
    {
        $cm = new CronManager();
        $crons = $cm->get();
        $cron = $crons[$id];

        $data = array();
        $data['file'] =  ($type == 'log') ? $cron->getLogFile(): $cron->getErrorFile();
        $data['content'] = \file_get_contents($data['file']);

        $serializer = new Serializer(array(), array('json' => new JsonEncoder()));

        return new Response($serializer->serialize($data, 'json'));
    }
public function fileAction($id, $type)
    {
        $cm = new CronManager();
        $crons = $cm->get();
        $cron = $crons[$id];

        $data = array();
        $data['file'] =  ($type == 'log') ? $cron->getLogFile(): $cron->getErrorFile();
        $data['content'] = \file_get_contents($data['file']);

        $serializer = new Serializer(array(), array('json' => new JsonEncoder()));

        return new Response($serializer->serialize($data, 'json'));
    }
public function fileAction ( $ id , $ type ) { $ cm = new CronManager ( ) ; $ crons = $ cm -> get ( ) ; $ cron = $ crons [ $ id ] ; $ data = array ( ) ; $ data [ 'file' ] = ( $ type == 'log' ) ? $ cron -> getLogFile ( ) : $ cron -> getErrorFile ( ) ; $ data [ 'content' ] = \ file_get_contents ( $ data [ 'file' ] ) ; $ serializer = new Serializer ( array ( ) , array ( 'json' => new JsonEncoder ( ) ) ) ; return new Response ( $ serializer -> serialize ( $ data , 'json' ) ) ; }
Gets a log file

@param $id int The line of the cron in the cron table
@param $type sting The type of file, log or error
@return \Symfony\Component\HttpFoundation\Response
Gets a log file