1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-07 13:46:38 +02:00

replace deprecated method calls in GelfMessageFormatter (#1664)

- the getter/setter methods for file, level and facility are deprecated in gelf v1.1
- add those fields as additional instead, as suggested in the gelf spec (https://docs.graylog.org/v1/docs/gelf#gelf-payload-specification)
- update tests to reflect changes
This commit is contained in:
Jan-Eric Ortgies
2022-05-08 23:13:55 +02:00
committed by GitHub
parent acc142c2b7
commit 709cb93aa6
3 changed files with 16 additions and 17 deletions

View File

@@ -55,7 +55,7 @@ class GelfHandlerTest extends TestCase
$expectedMessage = new Message();
$expectedMessage
->setLevel(7)
->setFacility("test")
->setAdditional('facility', 'test')
->setShortMessage($record->message)
->setTimestamp($record->datetime)
;
@@ -76,7 +76,7 @@ class GelfHandlerTest extends TestCase
$expectedMessage = new Message();
$expectedMessage
->setLevel(4)
->setFacility("test")
->setAdditional('facility', 'test')
->setShortMessage($record->message)
->setTimestamp($record->datetime)
;
@@ -103,7 +103,7 @@ class GelfHandlerTest extends TestCase
$expectedMessage = new Message();
$expectedMessage
->setLevel(4)
->setFacility("test")
->setAdditional('facility', 'test')
->setHost("mysystem")
->setShortMessage($record->message)
->setTimestamp($record->datetime)