16use PhpAmqpLib\Message\AMQPMessage;
17use PhpAmqpLib\Channel\AMQPChannel;
42 } elseif (
$exchange instanceof AMQPChannel) {
45 throw new \InvalidArgumentException(
'PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
55 protected function write(array $record)
57 $data = $record[
"formatted"];
59 $routingKey = sprintf(
62 substr($record[
'level_name'], 0, 4),
66 if ($this->exchange instanceof AMQPExchange) {
67 $this->exchange->publish(
69 strtolower($routingKey),
73 'Content-type' =>
'application/json'
77 $this->exchange->basic_publish(
82 'content_type' =>
'application/json'
86 strtolower($routingKey)
Base Handler class providing the Handler structure.
write(array $record)
Writes the record down to the log of the implementing handler.void
__construct($exchange, $exchangeName='log', $level=Logger::DEBUG, $bubble=true)
getDefaultFormatter()
Gets the default formatter.FormatterInterface
const DEBUG
Detailed debug information.