mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 10:20:14 +02:00
use mb_ functions in GelfFormatter
This commit is contained in:
@@ -251,6 +251,26 @@ class GelfMessageFormatterTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertGreaterThanOrEqual(131289, $length, 'The message should not be truncated');
|
||||
}
|
||||
|
||||
public function testFormatWithLargeCyrillicData()
|
||||
{
|
||||
$formatter = new GelfMessageFormatter();
|
||||
$record = [
|
||||
'level' => Logger::ERROR,
|
||||
'level_name' => 'ERROR',
|
||||
'channel' => 'meh',
|
||||
'context' => ['exception' => str_repeat('а', 32767)],
|
||||
'datetime' => new \DateTimeImmutable("@0"),
|
||||
'extra' => ['key' => str_repeat('б', 32767)],
|
||||
'message' => str_repeat('в', 32767),
|
||||
];
|
||||
$message = $formatter->format($record);
|
||||
$messageArray = $message->toArray();
|
||||
|
||||
$messageString = json_encode($messageArray);
|
||||
|
||||
$this->assertIsString($messageString);
|
||||
}
|
||||
|
||||
private function isLegacy()
|
||||
{
|
||||
return interface_exists('\Gelf\IMessagePublisher');
|
||||
|
Reference in New Issue
Block a user