Skip to content

Commit

Permalink
Merge pull request #8 from skurfuerst/skip-exception-codes
Browse files Browse the repository at this point in the history
FEATURE: Allow to skip exception codes from logging in Graylog
  • Loading branch information
Bastian Waidelich committed Apr 25, 2017
2 parents 68ee777 + b293ac7 commit 30629eb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Classes/Error/GraylogExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}
}

0 comments on commit 30629eb

Please sign in to comment.