<?php
namespace Api\EventListener;
use Api\Service\RequestLogManager;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
class RequestLogListener {
private $requestLogManager;
public function __construct(RequestLogManager $requestLogManager)
{
$this->requestLogManager = $requestLogManager;
}
public function onKernelResponse(ResponseEvent $event)
{
$this->requestLogManager->saveLog($event->getRequest(), $event->getResponse());
}
}