Added .rst documentation for LoggerAppenderAMQP Minor changes in xml docs for LoggerAppenderAMQP
Signed-off-by: Ivan Habunek <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/logging-log4php/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4php/commit/c91b0a41 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4php/tree/c91b0a41 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4php/diff/c91b0a41 Branch: refs/heads/develop Commit: c91b0a41a1927938e0953bd628ff65e3cead54ca Parents: c2930f2 Author: Dmitriy Ulyanov <[email protected]> Authored: Mon Feb 24 01:41:15 2014 +0400 Committer: Ivan Habunek <[email protected]> Committed: Thu May 15 09:28:29 2014 +0200 ---------------------------------------------------------------------- docs/appenders/amqp.rst | 112 +++++++++++++++++++++++++++++ src/site/xdoc/docs/appenders/amqp.xml | 12 ++-- 2 files changed, 117 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/c91b0a41/docs/appenders/amqp.rst ---------------------------------------------------------------------- diff --git a/docs/appenders/amqp.rst b/docs/appenders/amqp.rst new file mode 100644 index 0000000..d12d3b1 --- /dev/null +++ b/docs/appenders/amqp.rst @@ -0,0 +1,112 @@ +===================== +LoggerAppenderMongoDB +===================== + +``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. + +Layout +------ + +This appender requires a layout. If no layout is specified in configuration, +``LoggerLayoutSimple`` will be used by default. + +Parameters +---------- +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 | How long a connection can take to be opened | +| | | | | before timing out (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. | ++------------------------+---------+----------+---------------------+-----------------------------------------------+ + +Examples +-------- +This example shows how to configure ``LoggerAppenderAMQP`` to log to a remote +database. + +.. container:: tabs + + .. rubric:: XML format +.. code-block:: xml + + <configuration xmlns="http://logging.apache.org/log4php/"> + <appender name="default" class="LoggerAppenderAMQP"> + <param name="host" value="example.com" /> + <param name="vhost" value="/logs" /> + <param name="login" value="my_login" /> + <param name="password" value="my_secret_password" /> + <param name="exchangeName" value="my_exchange" /> + <param name="routingKey" value="php_application" /> + </appender> + <root> + <appender_ref ref="default" /> + </root> + </configuration> + + .. rubric:: PHP format +.. code-block:: php + + array( + 'appenders' => array( + 'default' => array( + 'class' => 'LoggerAppenderAMQP', + 'params' => array( + 'host' => 'example.com', + 'vhost' => '/logs', + 'login' => 'my_login', + 'password' => 'my_secret_password', + 'exchangeName' => 'my_exchange', + 'routingKey' => 'php_application', + ), + ), + ), + 'rootLogger' => array( + 'appenders' => array('default'), + ), + ); + +.. Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/c91b0a41/src/site/xdoc/docs/appenders/amqp.xml ---------------------------------------------------------------------- diff --git a/src/site/xdoc/docs/appenders/amqp.xml b/src/site/xdoc/docs/appenders/amqp.xml index 31478d7..a36031f 100644 --- a/src/site/xdoc/docs/appenders/amqp.xml +++ b/src/site/xdoc/docs/appenders/amqp.xml @@ -111,7 +111,7 @@ <td>float</td> <td>No</td> <td>0.5</td> - <td>Connection timeout in seconds.</td> + <td>How long a connection can take to be opened before timing out (in seconds).</td> </tr> <tr> <td>contentType</td> @@ -152,9 +152,8 @@ <pre class="prettyprint"><