Im trying to send response to user and after it make hard work in my service. I found another thread there(How tout use kernel.terminate Event in a Service). But it doesnt works.When i tried make like in there i got next messages in my logs: php.INFO: User Deprecated: Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" So then i tried it like that:
public function makeHardWork()
{
$this->dispatcher->addListener(KernelEvents::TERMINATE, function (Event $event){
$this->logger->log(LogLevel::ERROR,'123456');
},1);
}
Also i tried to dump $kernel in index.php and there is my subscriber. But nothing logs. What should i do for it works?