diff --git a/Classes/Error/GraylogExceptionHandler.php b/Classes/Error/GraylogExceptionHandler.php index 66a6034..ccb27d7 100644 --- a/Classes/Error/GraylogExceptionHandler.php +++ b/Classes/Error/GraylogExceptionHandler.php @@ -28,10 +28,15 @@ class GraylogExceptionHandler extends ProductionExceptionHandler */ protected function echoExceptionWeb($exception) { + if ($this->graylogService === null) { $this->graylogService = new GraylogService(); } - $this->graylogService->logException($exception); + + if (isset($this->renderingOptions['logException']) && $this->renderingOptions['logException']) { + $this->graylogService->logException($exception); + } + parent::echoExceptionWeb($exception); } @@ -44,7 +49,11 @@ protected function echoExceptionCli($exception) if ($this->graylogService === null) { $this->graylogService = new GraylogService(); } - $this->graylogService->logException($exception); + + if (isset($this->renderingOptions['logException']) && $this->renderingOptions['logException']) { + $this->graylogService->logException($exception); + } + parent::echoExceptionCli($exception); } }