ArdentLoggerBundle/Controller/LogViewController.php

23 lines
559 B
PHP
Raw Normal View History

2019-05-29 17:44:49 +02:00
<?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,
]);
}
}