23 if (!class_exists(
'Gelf\Publisher') || !class_exists(
'Gelf\Message')) {
24 $this->markTestSkipped(
"graylog2/gelf-php not installed");
34 $this->assertInstanceOf(
'Monolog\Handler\GelfHandler',
$handler);
46 return $this->getMock(
'Gelf\Publisher',
array(
'publish'),
array(),
'',
false);
52 $expectedMessage =
new Message();
56 ->setShortMessage($record[
'message'])
57 ->setTimestamp($record[
'datetime'])
61 $messagePublisher->expects($this->once())
63 ->with($expectedMessage);
73 $expectedMessage =
new Message();
77 ->setShortMessage($record[
'message'])
78 ->setTimestamp($record[
'datetime'])
82 $messagePublisher->expects($this->once())
84 ->with($expectedMessage);
94 $record[
'extra'][
'blarg'] =
'yep';
95 $record[
'context'][
'from'] =
'logger';
97 $expectedMessage =
new Message();
100 ->setFacility(
"test")
101 ->setHost(
"mysystem")
102 ->setShortMessage($record[
'message'])
103 ->setTimestamp($record[
'datetime'])
104 ->setAdditional(
"EXTblarg",
'yep')
105 ->setAdditional(
"CTXfrom",
'logger')
109 $messagePublisher->expects($this->once())
111 ->with($expectedMessage);
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.
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
testInjectedGelfMessageFormatter()
testConstruct()
Monolog::__construct