23 lines
559 B
PHP
23 lines
559 B
PHP
|
<?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);
|
||
|
|
||
|
return $this->render('@ArdentLogger/errors.html.twig', [
|
||
|
'logs' => $logs,
|
||
|
]);
|
||
|
}
|
||
|
}
|