Skip to content

Commit c8313d6

Browse files
committed
getReducedRecord fixed
1 parent 3f8c46d commit c8313d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Handler/JsonToStdErrHandler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ public function getReducedRecord(array &$record, $keyName): string
134134
$excessCharactersInTheRecord = mb_strlen($result) - self::MAX_RECORD_LENGTH;
135135
if ($excessCharactersInTheRecord > 0) {
136136
// находим насколько мы должны подрезать value:
137-
$newValueMaxLength = mb_strlen($value) - $excessCharactersInTheRecord - $explanationLength;
137+
$valueAsString = $this->getJson($value);
138+
$newValueMaxLength = mb_strlen($valueAsString) - $excessCharactersInTheRecord - $explanationLength;
138139
if ($newValueMaxLength > 0) {// даем пояснение + подрезаем value:
139-
$record[$keyName][$key] = $explanation . mb_substr($value, 0, $newValueMaxLength);
140+
$record[$keyName][$key] = $explanation . mb_substr($valueAsString, 0, $newValueMaxLength);
140141
} else {// символов на подрезку не остается, увы удаляем value:
141142
$record[$keyName][$key] = self::THE_LOG_ENTRY_IS_TOO_LONG;
142143
}

0 commit comments

Comments
 (0)