1
0
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:
Jordi Boggiano
2016-04-02 14:13:15 +01:00
3 changed files with 51 additions and 2 deletions

View File

@@ -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');