I\'ve got a random problem that I can\'t narrow down. Occasionally, I will get the following error in a Symfony2 application:
Uncaught Exception: An e
Define a service like this:
And a class like this:
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
class KernelExceptionListener
{
private $logger;
public function __construct(Monolog\Logger $logger)
{
$this->logger = $logger;
}
public function onKernelException(GetResponseForExceptionEvent $event)
{
// Here check the exception
//$event->getException()
}
}