42 } elseif (
$exchange instanceof AMQPChannel) {
45 throw new \InvalidArgumentException(
'PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
57 $data = $record[
"formatted"];
61 $this->exchange->publish(
67 'content_type' =>
'application/json',
71 $this->exchange->basic_publish(
85 parent::handleBatch($records);
90 foreach ($records as $record) {
98 $this->exchange->batch_basic_publish(
105 $this->exchange->publish_batch();
116 $routingKey = sprintf(
119 substr($record[
'level_name'], 0, 4),
123 return strtolower($routingKey);
132 return new AMQPMessage(
135 'delivery_mode' => 2,
136 'content_type' =>
'application/json',
const DEBUG
Detailed debug information.
__construct($exchange, $exchangeName='log', $level=Logger::DEBUG, $bubble=true)
Base Handler class providing the Handler structure.
handleBatch(array $records)
Handles a set of records at once.The records to handle (an array of record arrays) ...
getRoutingKey(array $record)
Gets the routing key for the AMQP exchange.
getFormatter()
{Gets the formatter.FormatterInterface}
Create styles array
The data for the language used.
isHandling(array $record)
{Checks whether the given record will be handled by this handler.This is mostly done for performance ...
processRecord(array $record)
Processes a record.