1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 12:17:35 +02:00

Add context to fluentd formatter

This commit is contained in:
tnucera
2017-07-11 12:40:56 +02:00
committed by Jordi Boggiano
parent 9893ae5d1e
commit 678693e5ef
2 changed files with 3 additions and 2 deletions

View File

@@ -62,6 +62,7 @@ class FluentdFormatter implements FormatterInterface
$message = array( $message = array(
'message' => $record['message'], 'message' => $record['message'],
'context' => $record['context'],
'extra' => $record['extra'], 'extra' => $record['extra'],
); );

View File

@@ -40,7 +40,7 @@ class FluentdFormatterTest extends TestCase
$formatter = new FluentdFormatter(); $formatter = new FluentdFormatter();
$this->assertEquals( $this->assertEquals(
'["test",0,{"message":"test","extra":[],"level":300,"level_name":"WARNING"}]', '["test",0,{"message":"test","context":[],"extra":[],"level":300,"level_name":"WARNING"}]',
$formatter->format($record) $formatter->format($record)
); );
} }
@@ -55,7 +55,7 @@ class FluentdFormatterTest extends TestCase
$formatter = new FluentdFormatter(true); $formatter = new FluentdFormatter(true);
$this->assertEquals( $this->assertEquals(
'["test.error",0,{"message":"test","extra":[]}]', '["test.error",0,{"message":"test","context":[],"extra":[]}]',
$formatter->format($record) $formatter->format($record)
); );
} }