Add log viewer
This commit is contained in:
24
Controller/LogViewController.php
Normal file
24
Controller/LogViewController.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Ardent\LoggerBundle\Controller;
|
||||
|
||||
use App\Ardent\LoggerBundle\Service\LoggerService;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class LogViewController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route(path="/view/latest/{amount}")
|
||||
*/
|
||||
public function latestLogs(LoggerService $ls, $amount = 10)
|
||||
{
|
||||
$logs = $ls->getLatest($amount);
|
||||
|
||||
dump(($logs));
|
||||
|
||||
return $this->render('@ArdentLogger/errors.html.twig', [
|
||||
'logs' => $logs,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user