mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-30 09:50:26 +02:00
map loglevel (int-value) to log-message, as well
This commit is contained in:
@@ -83,6 +83,9 @@ class LogstashFormatter extends NormalizerFormatter
|
||||
if (isset($record['level_name'])) {
|
||||
$message['level'] = $record['level_name'];
|
||||
}
|
||||
if (isset($record['level'])) {
|
||||
$message['level_num'] = $record['level'];
|
||||
}
|
||||
if ($this->applicationName) {
|
||||
$message['type'] = $this->applicationName;
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('log', $message['message']);
|
||||
$this->assertEquals('meh', $message['channel']);
|
||||
$this->assertEquals('ERROR', $message['level']);
|
||||
$this->assertEquals(Logger::ERROR, $message['level_num']);
|
||||
$this->assertEquals('test', $message['type']);
|
||||
$this->assertEquals('hostname', $message['host']);
|
||||
|
||||
|
Reference in New Issue
Block a user