params['log']['maxFileSize']) && Yii::$app->params['log']['maxFileSize'] > 1) { $model->maxFileSize = Yii::$app->params['log']['maxFileSize']; } if (isset(Yii::$app->params['log']['maxLogFiles']) && Yii::$app->params['log']['maxLogFiles'] > 1) { $model->maxLogFiles = Yii::$app->params['log']['maxLogFiles']; } $model->logFile = Yii::getAlias(Yii::$app->params['log']['dir']) . $prefixFile . (empty($prefixFile) ? $type : ucfirst($type) ) . '.log'; $model->messages = [$result]; $model->export(); } public function formatMessage($result) { return sprintf( "[%s]\t%s\t%s", date(\DateTime::ISO8601), getmypid(), json_encode($result, JSON_UNESCAPED_UNICODE) ); } }