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

Raven client fingerprint support

This commit is contained in:
Dmitriy Garanzha
2016-01-20 11:39:44 +02:00
parent 592af02d0c
commit e2a77060da
2 changed files with 16 additions and 0 deletions

View File

@@ -139,6 +139,10 @@ class RavenHandler extends AbstractProcessingHandler
$options['tags'] = array_merge($options['tags'], $record['context']['tags']);
unset($record['context']['tags']);
}
if (!empty($record['context']['fingerprint'])) {
$options['fingerprint'] = $record['context']['fingerprint'];
unset($record['context']['fingerprint']);
}
if (!empty($record['context']['logger'])) {
$options['logger'] = $record['context']['logger'];
unset($record['context']['logger']);

View File

@@ -99,6 +99,18 @@ class RavenHandlerTest extends TestCase
$this->assertEquals($release, $ravenClient->lastData['release']);
}
public function testFingerprint()
{
$ravenClient = $this->getRavenClient();
$handler = $this->getHandler($ravenClient);
$fingerprint = array('{{ default }}', 'other value');
$record = $this->getRecord(Logger::INFO, 'test', array('fingerprint' => $fingerprint));
$handler->handle($record);
$this->assertEquals($fingerprint, $ravenClient->lastData['fingerprint']);
}
public function testUserContext()
{
$ravenClient = $this->getRavenClient();