Beispiel #1
0
 /**
  * {@inheritDoc}
  */
 protected function write(array $record)
 {
     $data = $record["formatted"];
     $routingKey = $this->getRoutingKey($record);
     if ($this->exchange instanceof AMQPExchange) {
         $this->exchange->publish($data, $routingKey, 0, array('delivery_mode' => 2, 'content_type' => 'application/json'));
     } else {
         $this->exchange->basic_publish($this->createAmqpMessage($data), $this->exchangeName, $routingKey);
     }
 }
Beispiel #2
0
 /**
  *
  * {@inheritDoc}
  *
  */
 protected function write(array $record)
 {
     $data = $record["formatted"];
     $routingKey = sprintf('%s.%s', substr($record['level_name'], 0, 4), $record['channel']);
     if ($this->exchange instanceof AMQPExchange) {
         $this->exchange->publish($data, strtolower($routingKey), 0, array('delivery_mode' => 2, 'Content-type' => 'application/json'));
     } else {
         $this->exchange->basic_publish(new AMQPMessage((string) $data, array('delivery_mode' => 2, 'content_type' => 'application/json')), $this->exchangeName, strtolower($routingKey));
     }
 }