diff --git a/src/Monolog/Handler/RavenHandler.php b/src/Monolog/Handler/RavenHandler.php index 38fbeb25..9a85293a 100644 --- a/src/Monolog/Handler/RavenHandler.php +++ b/src/Monolog/Handler/RavenHandler.php @@ -47,7 +47,7 @@ class RavenHandler extends AbstractProcessingHandler /** * @var LineFormatter The formatter to use for the logs generated via handleBatch() */ - protected $logFormatter; + protected $batchFormatter; /** * @param Raven_Client $ravenClient @@ -93,7 +93,7 @@ class RavenHandler extends AbstractProcessingHandler } if ($logs) { - $record['context']['logs'] = (string) $this->getLogFormatter()->formatBatch($logs); + $record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs); } $this->handle($record); @@ -104,9 +104,9 @@ class RavenHandler extends AbstractProcessingHandler * * @param FormatterInterface $formatter */ - public function setLogFormatter(FormatterInterface $formatter) + public function setBatchFormatter(FormatterInterface $formatter) { - $this->logFormatter = $formatter; + $this->batchFormatter = $formatter; } /** @@ -114,13 +114,13 @@ class RavenHandler extends AbstractProcessingHandler * * @return FormatterInterface */ - public function getLogFormatter() + public function getBatchFormatter() { - if (!$this->logFormatter) { - $this->logFormatter = $this->getDefaultLogFormatter(); + if (!$this->batchFormatter) { + $this->batchFormatter = $this->getDefaultBatchFormatter(); } - return $this->logFormatter; + return $this->batchFormatter; } /** @@ -159,7 +159,7 @@ class RavenHandler extends AbstractProcessingHandler * * @return FormatterInterface */ - protected function getDefaultLogFormatter() + protected function getDefaultBatchFormatter() { return new LineFormatter(); } diff --git a/tests/Monolog/Handler/RavenHandlerTest.php b/tests/Monolog/Handler/RavenHandlerTest.php index 9b548c2e..9c13c3f4 100644 --- a/tests/Monolog/Handler/RavenHandlerTest.php +++ b/tests/Monolog/Handler/RavenHandlerTest.php @@ -100,7 +100,7 @@ class RavenHandlerTest extends TestCase $formatter->expects($this->once())->method('format'); $handler = $this->getHandler($this->getRavenClient()); - $handler->setLogFormatter($logFormatter); + $handler->setBatchFormatter($logFormatter); $handler->setFormatter($formatter); $handler->handleBatch($records); } @@ -119,13 +119,13 @@ class RavenHandlerTest extends TestCase $handler->handleBatch($records); } - public function testGetSetLogFormatter() + public function testGetSetBatchFormatter() { $ravenClient = $this->getRavenClient(); $handler = $this->getHandler($ravenClient); - $handler->setLogFormatter($formatter = new LineFormatter()); - $this->assertSame($formatter, $handler->getLogFormatter()); + $handler->setBatchFormatter($formatter = new LineFormatter()); + $this->assertSame($formatter, $handler->getBatchFormatter()); } private function methodThatThrowsAnException()