mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-02 19:27:37 +02:00
Merge pull request #630 from prgTW/feat/raven-handles-checksum
RavenHandler handles custom checksums
This commit is contained in:
@@ -145,6 +145,14 @@ class RavenHandler extends AbstractProcessingHandler
|
||||
} else {
|
||||
$options['logger'] = $record['channel'];
|
||||
}
|
||||
if (!empty($record['extra']['checksum'])) {
|
||||
$options['checksum'] = $record['extra']['checksum'];
|
||||
unset($record['extra']['checksum']);
|
||||
}
|
||||
if (!empty($record['context']['checksum'])) {
|
||||
$options['checksum'] = $record['context']['checksum'];
|
||||
unset($record['context']['checksum']);
|
||||
}
|
||||
if (!empty($record['context'])) {
|
||||
$options['extra']['context'] = $record['context'];
|
||||
if (!empty($record['context']['user'])) {
|
||||
|
@@ -85,6 +85,18 @@ class RavenHandlerTest extends TestCase
|
||||
$this->assertEquals($tags, $ravenClient->lastData['tags']);
|
||||
}
|
||||
|
||||
public function testChecksum()
|
||||
{
|
||||
$ravenClient = $this->getRavenClient();
|
||||
$handler = $this->getHandler($ravenClient);
|
||||
|
||||
$checksum = '098f6bcd4621d373cade4e832627b4f6';
|
||||
$record = $this->getRecord(Logger::INFO, 'test', array('checksum' => $checksum));
|
||||
$handler->handle($record);
|
||||
|
||||
$this->assertEquals($checksum, $ravenClient->lastData['checksum']);
|
||||
}
|
||||
|
||||
public function testUserContext()
|
||||
{
|
||||
$ravenClient = $this->getRavenClient();
|
||||
|
Reference in New Issue
Block a user