|
|
@@ -93,10 +93,10 @@ class GelfMessageFormatter extends NormalizerFormatter
|
|
|
->setLevel($this->logLevels[$record['level']]);
|
|
|
|
|
|
// message length + system name length + 200 for padding / metadata
|
|
|
- $len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
|
|
|
+ $len = 200 + mb_strlen((string) $record['message']) + mb_strlen($this->systemName);
|
|
|
|
|
|
if ($len > $this->maxLength) {
|
|
|
- $message->setShortMessage(substr($record['message'], 0, $this->maxLength));
|
|
|
+ $message->setShortMessage(mb_substr($record['message'], 0, $this->maxLength));
|
|
|
}
|
|
|
|
|
|
if (isset($record['channel'])) {
|
|
|
@@ -113,9 +113,9 @@ class GelfMessageFormatter extends NormalizerFormatter
|
|
|
|
|
|
foreach ($record['extra'] as $key => $val) {
|
|
|
$val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
|
|
|
- $len = strlen($this->extraPrefix . $key . $val);
|
|
|
+ $len = mb_strlen($this->extraPrefix . $key . $val);
|
|
|
if ($len > $this->maxLength) {
|
|
|
- $message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength));
|
|
|
+ $message->setAdditional($this->extraPrefix . $key, mb_substr($val, 0, $this->maxLength));
|
|
|
continue;
|
|
|
}
|
|
|
$message->setAdditional($this->extraPrefix . $key, $val);
|
|
|
@@ -123,9 +123,9 @@ class GelfMessageFormatter extends NormalizerFormatter
|
|
|
|
|
|
foreach ($record['context'] as $key => $val) {
|
|
|
$val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
|
|
|
- $len = strlen($this->contextPrefix . $key . $val);
|
|
|
+ $len = mb_strlen($this->contextPrefix . $key . $val);
|
|
|
if ($len > $this->maxLength) {
|
|
|
- $message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength));
|
|
|
+ $message->setAdditional($this->contextPrefix . $key, mb_substr($val, 0, $this->maxLength));
|
|
|
continue;
|
|
|
}
|
|
|
$message->setAdditional($this->contextPrefix . $key, $val);
|