1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-29 11:26:09 +01:00
This commit is contained in:
Jordi Boggiano
2012-12-14 12:15:30 +01:00
parent 6588c1633e
commit 9c8db38385
8 changed files with 9 additions and 12 deletions

View File

@@ -11,10 +11,9 @@
namespace Monolog\Formatter;
use Monolog\Logger;
/**
* Serializes a log message to Logstash Event Format
*
* @see http://logstash.net/
* @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb
*
@@ -66,14 +65,15 @@ class LogstashFormatter extends NormalizerFormatter
'@message' => $record['message'],
'@tags' => array($record['channel']),
'@source' => $this->systemName
);
);
if (isset($this->applicationName)) {
$message['@type'] = $this->applicationName;
if ($this->applicationName) {
$message['@type'] = $this->applicationName;
}
$message['@fields'] = array();
$message['@fields']['channel'] = $record['channel'];
$message['@fields']['level'] = $record['level'];
if (isset($record['extra']['server'])) {
$message['@source_host'] = $record['extra']['server'];
}

View File

@@ -67,6 +67,7 @@ class BufferHandler extends AbstractHandler
$this->buffer[] = $record;
$this->bufferSize++;
return false === $this->bubble;
}

View File

@@ -14,7 +14,6 @@ namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\Formatter\LineFormatter;
/**
* Logs to syslog service.
*