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:
@@ -62,6 +62,7 @@ class FluentdFormatter implements FormatterInterface
|
||||
|
||||
$message = array(
|
||||
'message' => $record['message'],
|
||||
'context' => $record['context'],
|
||||
'extra' => $record['extra'],
|
||||
);
|
||||
|
||||
|
@@ -40,7 +40,7 @@ class FluentdFormatterTest extends TestCase
|
||||
|
||||
$formatter = new FluentdFormatter();
|
||||
$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)
|
||||
);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ class FluentdFormatterTest extends TestCase
|
||||
|
||||
$formatter = new FluentdFormatter(true);
|
||||
$this->assertEquals(
|
||||
'["test.error",0,{"message":"test","extra":[]}]',
|
||||
'["test.error",0,{"message":"test","context":[],"extra":[]}]',
|
||||
$formatter->format($record)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user