[FrameworkBundle] changed error_log() calls to logger calls

This commit is contained in:
Fabien Potencier 2010-08-14 22:37:33 +02:00
parent 0da7295a9c
commit 917da00763

View File

@ -70,9 +70,13 @@ class ExceptionListener
try {
$response = $event->getSubject()->handle($request, HttpKernelInterface::SUB_REQUEST, true);
error_log(sprintf('%s: %s', get_class($exception), $exception->getMessage()));
if (null !== $this->logger) {
$this->logger->err(sprintf('%s: %s', get_class($exception), $exception->getMessage()));
}
} catch (\Exception $e) {
error_log(sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage()));
if (null !== $this->logger) {
$this->logger->err(sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage()));
}
return false;
}