send() публичный Метод

Formats and sends the data to a backend using the suitable method depending on protocol
public send ( array $data ) : boolean
$data array Prepared array of data to send
Результат boolean Indicates whether operation was successful
Пример #1
0
 /**
  * Logs event to a specified backend
  *
  * @param  string  $event      Event tag
  * @param  mixed   $extra      optional Extra data to pass.
  * @param  mixed   $extra,...  optional
  * @return boolean Indicates whether operation was successful
  * @throws AuditLoggerException
  */
 public function log($event, ...$extra)
 {
     if (!$this->enabled) {
         return true;
     }
     if (!empty($extra)) {
         if (array_key_exists($event, $this->subscribers)) {
             $extra = $this->subscribers[$event](...$extra);
         } else {
             $extra = $extra[0];
         }
     } else {
         $extra = [];
     }
     $adjusted = [];
     foreach ($extra as $key => $val) {
         if (($pos = strpos($key, '.')) === 0) {
             //It will adjust data key with the event name when the key either does not contain
             //dot or starts with dot.
             $adjusted[$event . $key] = $val;
         } else {
             $adjusted[$key] = $val;
         }
     }
     $adjusted = array_merge($this->getCommonData(), $adjusted);
     $adjusted["tags"] = [$event];
     if (!empty($this->defaultTag)) {
         $adjusted["tags"][] = $this->defaultTag;
     }
     $data = ["tag" => $this->defaultTag, "message" => $event, "extra" => $adjusted];
     try {
         $result = $this->writer->send($data);
     } catch (Exception $e) {
         \Scalr::logException(new Exception(sprintf("Logger couldn't log the record: %s", $e->getMessage()), $e->getCode(), $e));
         $result = false;
     }
     return $result;
 }