diff --git a/src/Target.php b/src/Target.php index 89d82d8..51f0fc5 100644 --- a/src/Target.php +++ b/src/Target.php @@ -12,6 +12,7 @@ use sergeymakinen\yii\logmessage\Message; use yii\base\InvalidValueException; use yii\di\Instance; +use yii\helpers\StringHelper; use yii\httpclient\Client; use yii\log\Logger; @@ -71,6 +72,11 @@ class Target extends \yii\log\Target Logger::LEVEL_TRACE => '📝', ]; + /** + * @var int max character in message text. + */ + public $substitutionMaxLength = 3000; + /** * @inheritDoc */ @@ -231,6 +237,7 @@ private function substitute($name, Message $message) } if ($config['wrapAsCode']) { + $value = StringHelper::truncate($value, $this->substitutionMaxLength); if ($config['short']) { $value = '`' . $value . '`'; } else {