1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 23:24:02 +02:00

Added an handler for NewRelic:

* implemented a test which verifies that the fallback handler handles records when the NewRelic PHP extension is not installes
* implemented the actual handler
This commit is contained in:
Alessandro Nadalin
2012-08-23 00:43:49 +04:00
committed by odino
parent 050bb52fd8
commit b439707cbb
2 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
class NewRelicHandlerTest extends TestCase
{
public function testFallbackHandler()
{
$handler = new NewRelicHandler();
$fallbackHandler = new TestHandler();
$handler->setFallbackHandler($fallbackHandler);
$record = array(
'level' => Logger::DEBUG,
'extra' => array(),
);
$handler->handle($record);
$this->assertCount(1, $fallbackHandler->getRecords());
}
}