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

Merge pull request #706 from acrobat/amqp_handler_fix

Removed substr call in amqp routing key generator
This commit is contained in:
Jordi Boggiano
2016-04-15 18:05:13 +01:00
2 changed files with 3 additions and 8 deletions

View File

@@ -114,12 +114,7 @@ class AmqpHandler extends AbstractProcessingHandler
*/ */
private function getRoutingKey(array $record) private function getRoutingKey(array $record)
{ {
$routingKey = sprintf( $routingKey = sprintf('%s.%s', $record['level_name'], $record['channel']);
'%s.%s',
// TODO 2.0 remove substr call
substr($record['level_name'], 0, 4),
$record['channel']
);
return strtolower($routingKey); return strtolower($routingKey);
} }

View File

@@ -61,7 +61,7 @@ class AmqpHandlerTest extends TestCase
'channel' => 'test', 'channel' => 'test',
'extra' => array(), 'extra' => array(),
), ),
'warn.test', 'warning.test',
0, 0,
array( array(
'delivery_mode' => 2, 'delivery_mode' => 2,
@@ -111,7 +111,7 @@ class AmqpHandlerTest extends TestCase
'extra' => array(), 'extra' => array(),
), ),
'log', 'log',
'warn.test', 'warning.test',
false, false,
false, false,
null, null,