mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 18:30:15 +02:00
Use facility additional value and not channel to be compat with existing Monolog 3 code
This commit is contained in:
@@ -135,7 +135,7 @@ class GelfMessageFormatter extends NormalizerFormatter
|
||||
unset($extra['file']);
|
||||
}
|
||||
} else {
|
||||
$message->setAdditional('channel', $record['channel']);
|
||||
$message->setAdditional('facility', $record['channel']);
|
||||
}
|
||||
|
||||
foreach ($extra as $key => $val) {
|
||||
|
@@ -50,7 +50,7 @@ class GelfMessageFormatterTest extends TestCase
|
||||
$this->assertEquals(null, $message->getLine());
|
||||
$this->assertEquals(null, $message->getFile());
|
||||
} else {
|
||||
$this->assertEquals('meh', $message->getAdditional('channel'));
|
||||
$this->assertEquals('meh', $message->getAdditional('facility'));
|
||||
}
|
||||
$this->assertEquals($this->isLegacy() ? 3 : 'error', $message->getLevel());
|
||||
$this->assertNotEmpty($message->getHost());
|
||||
@@ -172,7 +172,7 @@ class GelfMessageFormatterTest extends TestCase
|
||||
$this->assertEquals("/some/file/in/dir.php", $message->getFile());
|
||||
$this->assertEquals("56", $message->getLine());
|
||||
} else {
|
||||
$this->assertEquals(['channel' => 'meh', 'ctxt_exception' => '{"class":"\\\\Exception","file":"/some/file/in/dir.php:56","trace":["/some/file/1.php:23","/some/file/2.php:3"]}'], $message->getAllAdditionals());
|
||||
$this->assertEquals(['facility' => 'meh', 'ctxt_exception' => '{"class":"\\\\Exception","file":"/some/file/in/dir.php:56","trace":["/some/file/1.php:23","/some/file/2.php:3"]}'], $message->getAllAdditionals());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -62,7 +62,7 @@ class GelfHandlerTest extends TestCase
|
||||
if (self::isGelfVersion1()) {
|
||||
$expectedMessage->setFacility("test");
|
||||
} else {
|
||||
$expectedMessage->setAdditional('channel', "test");
|
||||
$expectedMessage->setAdditional('facility', "test");
|
||||
}
|
||||
|
||||
$messagePublisher = $this->getMessagePublisher();
|
||||
@@ -88,7 +88,7 @@ class GelfHandlerTest extends TestCase
|
||||
if (self::isGelfVersion1()) {
|
||||
$expectedMessage->setFacility("test");
|
||||
} else {
|
||||
$expectedMessage->setAdditional('channel', "test");
|
||||
$expectedMessage->setAdditional('facility', "test");
|
||||
}
|
||||
|
||||
$messagePublisher = $this->getMessagePublisher();
|
||||
@@ -120,7 +120,7 @@ class GelfHandlerTest extends TestCase
|
||||
if (self::isGelfVersion1()) {
|
||||
$expectedMessage->setFacility("test");
|
||||
} else {
|
||||
$expectedMessage->setAdditional('channel', "test");
|
||||
$expectedMessage->setAdditional('facility', "test");
|
||||
}
|
||||
|
||||
$messagePublisher = $this->getMessagePublisher();
|
||||
|
Reference in New Issue
Block a user