23 if (!class_exists(
'Gelf\MessagePublisher') || !class_exists(
'Gelf\Message')) {
24 $this->markTestSkipped(
"mlehner/gelf-php not installed");
27 require_once __DIR__ .
'/GelfMockMessagePublisher.php';
36 $this->assertInstanceOf(
'Monolog\Handler\GelfHandler',
$handler);
59 $this->assertEquals(7, $messagePublisher->lastMessage->getLevel());
60 $this->assertEquals(
'test', $messagePublisher->lastMessage->getFacility());
61 $this->assertEquals($record[
'message'], $messagePublisher->lastMessage->getShortMessage());
62 $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage());
73 $this->assertEquals(4, $messagePublisher->lastMessage->getLevel());
74 $this->assertEquals(
'test', $messagePublisher->lastMessage->getFacility());
75 $this->assertEquals($record[
'message'], $messagePublisher->lastMessage->getShortMessage());
76 $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage());
87 $record[
'extra'][
'blarg'] =
'yep';
88 $record[
'context'][
'from'] =
'logger';
91 $this->assertEquals(
'mysystem', $messagePublisher->lastMessage->getHost());
92 $this->assertArrayHasKey(
'_EXTblarg', $messagePublisher->lastMessage->toArray());
93 $this->assertArrayHasKey(
'_CTXfrom', $messagePublisher->lastMessage->toArray());
const DEBUG
Detailed debug information.
getHandler($messagePublisher)
getRecord($level=Logger::WARNING, $message='test', $context=array())
Handler to send messages to a Graylog2 (http://www.graylog2.org) server.
testInjectedGelfMessageFormatter()
const WARNING
Exceptional occurrences that are not errors.
testConstruct()
Monolog::__construct