src/Api/EventListener/RequestLogListener.php line 16

Open in your IDE?
  1. <?php
  2. namespace Api\EventListener;
  3. use Api\Service\RequestLogManager;
  4. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  5. class RequestLogListener {
  6.     private $requestLogManager;
  7.     public function __construct(RequestLogManager $requestLogManager)
  8.     {
  9.         $this->requestLogManager $requestLogManager;
  10.     }
  11.     public function onKernelResponse(ResponseEvent $event)
  12.     {
  13.         $this->requestLogManager->saveLog($event->getRequest(), $event->getResponse());
  14.     }
  15. }