1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 18:30:15 +02:00

Add prefixes to the context and extra record keys. Needed as some processors have the same keys as the the context. Specifically, the IntrospectionProcessor has "line" and "file" that can overwrite an error context "line" and "file".

This commit is contained in:
Mark Garrett
2014-09-29 11:04:41 -05:00
parent b3f039339d
commit e7647fd37d
2 changed files with 6 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ class NewRelicHandlerTest extends TestCase
{
$handler = new StubNewRelicHandler();
$handler->handle($this->getRecord(Logger::ERROR, 'log message', array('a' => 'b')));
$this->assertEquals(array('a' => 'b'), self::$customParameters);
$this->assertEquals(array('context_a' => 'b'), self::$customParameters);
}
public function testThehandlerCanAddExtraParamsToTheNewRelicTrace()
@@ -56,7 +56,7 @@ class NewRelicHandlerTest extends TestCase
$handler = new StubNewRelicHandler();
$handler->handle($record);
$this->assertEquals(array('c' => 'd'), self::$customParameters);
$this->assertEquals(array('extra_c' => 'd'), self::$customParameters);
}
public function testThehandlerCanAddExtraContextAndParamsToTheNewRelicTrace()
@@ -68,8 +68,8 @@ class NewRelicHandlerTest extends TestCase
$handler->handle($record);
$expected = array(
'a' => 'b',
'c' => 'd',
'context_a' => 'b',
'extra_c' => 'd',
);
$this->assertEquals($expected, self::$customParameters);