Add log viewer

This commit is contained in:
Tim
2019-05-29 17:44:49 +02:00
parent 49b9d139ec
commit 858f71e945
4 changed files with 46 additions and 2 deletions

View 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,
]);
}
}