LoggerAppenderAMQP appends log events to a AMQP instance.
The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol + for message-oriented middleware. The defining features of AMQP are message orientation, + queuing, routing (including point-to-point and publish-and-subscribe), reliability and security.
+ +This appender requires a layout. If no layout is specified in configuration,
+ LoggerLayoutSimple will be used by default.
The following parameters are available:
+ +| Parameter | +Type | +Required | +Default | +Description | +
|---|---|---|---|---|
| host | +string | +No | +localhost | +Server on which AMQP instance is located. | +
| port | +integer | +No | +5672 | +Port on which the instance is bound. | +
| vhost | +string | +No | +/ | +The name of the "virtual host". | +
| login | +string | +No | +guest | +Login used to connect to the AMQP server. | +
| password | +string | +No | +guest | +Password used to connect to the AMQP server. | +
| exchangeName | +string | +Yes | +- | +Name of AMQP exchange which used to routing logs. | +
| exchangeType | +string | +No | +direct | +Type of AMQP exchange. | +
| routingKey | +string | +Yes | +- | +Routing key which used to routing logs. | +
| connectionTimeout | +float | +No | +0.5 | +Connection timeout in seconds. | +
| contentType | +string | +No | +text/plain | +Content-type header. | +
| contentEncoding | +string | +No | +UTF-8 | +Content-encoding header. | +
| flushOnShutdown | +boolean | +No | +false | +Send logs immediately or stash it and send on shutdown. | +
This example shows how to configure LoggerAppenderAMQP to log to a remote server.
+++ + + + + + + + ++ + +]]>+
array(
+ 'default' => array(
+ 'class' => 'LoggerAppenderAMQP',
+ 'params' => array(
+ 'host' => 'localhost',
+ 'port' => 5672,
+ 'vhost' => '/',
+ 'login' => 'my_login',
+ 'password' => 'my_secret_password',
+ 'exchangeName' => 'my_exchange',
+ 'routingKey' => 'php_application',
+ ),
+ ),
+ ),
+ 'rootLogger' => array(
+ 'appenders' => array('default'),
+ ),
+);
+]]>
+