예제 #1
0
파일: Dump.php 프로젝트: cawaphp/cawa
 /**
  * {@inheritdoc}
  */
 protected function send(Event $event) : bool
 {
     $handler = VarDumper::setHandler();
     dump($event->format());
     VarDumper::setHandler($handler);
     return true;
 }
예제 #2
0
파일: SyslogUdp.php 프로젝트: cawaphp/cawa
 /**
  * {@inheritdoc}
  */
 protected function send(Event $event) : bool
 {
     if (!is_resource($this->resource)) {
         $this->resource = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
     }
     $message = $event->format(false);
     $udpMessage = '<' . ($this->facility + $this->convertType($event->getLevel())) . '>' . $event->getDate()->format('M d H:i:s') . ' ' . ($this->hostname ? $this->hostname . ' ' : '') . $this->name . ($this->pid ? '[' . $this->pid . ']' : '') . ': ' . $message . "";
     if (strlen($udpMessage) > self::DATAGRAM_MAX_LENGTH) {
         $udpMessage = substr($udpMessage, 0, self::DATAGRAM_MAX_LENGTH);
     }
     $length = strlen($udpMessage);
     $size = socket_sendto($this->resource, $udpMessage, $length, $flags = 0, $this->ip, $this->port);
     return $size == $length;
 }
예제 #3
0
파일: Syslog.php 프로젝트: cawaphp/cawa
 /**
  * {@inheritdoc}
  */
 protected function send(Event $event) : bool
 {
     $message = $event->format(false);
     openlog($this->name, LOG_ODELAY, $this->facility);
     $return = syslog($this->convertType($event->getLevel()), $message);
     closelog();
     return $return;
 }
예제 #4
0
파일: File.php 프로젝트: cawaphp/cawa
 /**
  * {@inheritdoc}
  */
 protected function send(Event $event) : bool
 {
     file_put_contents($this->path, $event->format(), FILE_APPEND);
     return true;
 }
예제 #5
0
파일: StdErr.php 프로젝트: cawaphp/cawa
 /**
  * {@inheritdoc}
  */
 protected function send(Event $event) : bool
 {
     file_put_contents('php://stderr', $event->format());
     return true;
 }