mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 21:56:31 +02:00
Cosmetic fixes
This commit is contained in:
@@ -106,14 +106,13 @@ Handlers
|
|||||||
[Mongo](http://pecl.php.net/package/mongo) extension connection.
|
[Mongo](http://pecl.php.net/package/mongo) extension connection.
|
||||||
- _NativeMailHandler_: Sends emails using PHP's
|
- _NativeMailHandler_: Sends emails using PHP's
|
||||||
[`mail()`](http://php.net/manual/en/function.mail.php) function.
|
[`mail()`](http://php.net/manual/en/function.mail.php) function.
|
||||||
- _SwiftMailerHandler_: Sends emails using a `Swift_Mailer` instance.
|
- _SwiftMailerHandler_: Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance.
|
||||||
- _SyslogHandler_: Logs records to the syslog.
|
- _SyslogHandler_: Logs records to the syslog.
|
||||||
- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server.
|
- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server.
|
||||||
- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
|
- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
|
||||||
for UNIX and TCP sockets. See an [example](https://github.com/Seldaek/monolog/blob/master/doc/sockets.md).
|
for UNIX and TCP sockets. See an [example](https://github.com/Seldaek/monolog/blob/master/doc/sockets.md).
|
||||||
- _AmqpHandler_L Logs records using [amqp](php.net/manual/en/book.amqp.php) protocol to the RabbitMQ server.
|
- _AmqpHandler_: Logs records to an [amqp](http://www.amqp.org/) compatible
|
||||||
Note: handler needs an installed amqp version > 1.
|
server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+).
|
||||||
For instructions on installation look in (http://lv.php.net/manual/en/amqp.installation.php)
|
|
||||||
|
|
||||||
Wrappers / Special Handlers
|
Wrappers / Special Handlers
|
||||||
---------------------------
|
---------------------------
|
||||||
@@ -164,7 +163,6 @@ Requirements
|
|||||||
|
|
||||||
- Any flavor of PHP 5.3 should do
|
- Any flavor of PHP 5.3 should do
|
||||||
- [optional] PHPUnit 3.5+ to execute the test suite (phpunit --version)
|
- [optional] PHPUnit 3.5+ to execute the test suite (phpunit --version)
|
||||||
- [optional] installed amqp library to use AmqpHandler.
|
|
||||||
|
|
||||||
Submitting bugs and feature requests
|
Submitting bugs and feature requests
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
@@ -1,27 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "monolog/monolog",
|
"name": "monolog/monolog",
|
||||||
"description": "Logging for PHP 5.3",
|
"description": "Logging for PHP 5.3",
|
||||||
"keywords": ["log","logging"],
|
"keywords": ["log","logging"],
|
||||||
"homepage": "http://github.com/Seldaek/monolog",
|
"homepage": "http://github.com/Seldaek/monolog",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Jordi Boggiano",
|
"name": "Jordi Boggiano",
|
||||||
"email": "j.boggiano@seld.be",
|
"email": "j.boggiano@seld.be",
|
||||||
"homepage": "http://seld.be"
|
"homepage": "http://seld.be"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"mlehner/gelf-php": "1.0.*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||||
|
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||||
|
"ext-mongo": "Allow sending log messages to a MongoDB server"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {"Monolog": "src/"}
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"mlehner/gelf-php": "1.0.*"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server"
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {"Monolog": "src/"}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -22,11 +22,11 @@ class AmqpHandler extends AbstractProcessingHandler
|
|||||||
protected $exchange;
|
protected $exchange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \AMQPExchange $exchange AMQP exchange, ready for use
|
* @param \AMQPExchange $exchange AMQP exchange, ready for use
|
||||||
* @param string $exchangeName
|
* @param string $exchangeName
|
||||||
* @param string $issuer isser name
|
* @param string $issuer issuer name
|
||||||
* @param int $level
|
* @param int $level
|
||||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
*/
|
*/
|
||||||
public function __construct(\AMQPExchange $exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true)
|
public function __construct(\AMQPExchange $exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true)
|
||||||
{
|
{
|
||||||
@@ -43,18 +43,21 @@ class AmqpHandler extends AbstractProcessingHandler
|
|||||||
{
|
{
|
||||||
$data = $record["formatted"];
|
$data = $record["formatted"];
|
||||||
|
|
||||||
$routingKey = sprintf('%s.%s',
|
$routingKey = sprintf(
|
||||||
|
'%s.%s',
|
||||||
substr($record['level_name'], 0, 4),
|
substr($record['level_name'], 0, 4),
|
||||||
$record['channel']);
|
$record['channel']
|
||||||
|
);
|
||||||
|
|
||||||
//we do not check return value because no handler really does
|
$this->exchange->publish(
|
||||||
$this->exchange->publish($data,
|
$data,
|
||||||
strtolower($routingKey),
|
strtolower($routingKey),
|
||||||
0,
|
0,
|
||||||
array(
|
array(
|
||||||
'delivery_mode' => 2,
|
'delivery_mode' => 2,
|
||||||
'Content-type' => 'application/json'
|
'Content-type' => 'application/json'
|
||||||
));
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user