mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-10 23:24:02 +02:00
Merge branch '1.x'
This commit is contained in:
@@ -197,6 +197,24 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('pair', $message_array['_EXTkey']);
|
||||
}
|
||||
|
||||
public function testFormatWithLargeData()
|
||||
{
|
||||
$formatter = new GelfMessageFormatter();
|
||||
$record = array(
|
||||
'level' => Logger::ERROR,
|
||||
'level_name' => 'ERROR',
|
||||
'channel' => 'meh',
|
||||
'context' => array('exception' => str_repeat(' ', 32767)),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => str_repeat(' ', 32767)),
|
||||
'message' => 'log'
|
||||
);
|
||||
$message = $formatter->format($record);
|
||||
$messageArray = $message->toArray();
|
||||
$this->assertLessThanOrEqual(32766, strlen($messageArray['_key']));
|
||||
$this->assertLessThanOrEqual(32766, strlen($messageArray['_ctxt_exception']));
|
||||
}
|
||||
|
||||
private function isLegacy()
|
||||
{
|
||||
return interface_exists('\Gelf\IMessagePublisher');
|
||||
|
Reference in New Issue
Block a user