mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 11:47:38 +02:00
SyslogUdpHandler: Send a valid rfc5424 version
https://tools.ietf.org/html/rfc5424#section-6.2.2
This commit is contained in:
@@ -63,11 +63,11 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
|||||||
/**
|
/**
|
||||||
* Make common syslog header (see rfc5424)
|
* Make common syslog header (see rfc5424)
|
||||||
*/
|
*/
|
||||||
private function makeCommonSyslogHeader($severity)
|
protected function makeCommonSyslogHeader($severity)
|
||||||
{
|
{
|
||||||
$priority = $severity + $this->facility;
|
$priority = $severity + $this->facility;
|
||||||
|
|
||||||
return "<$priority>: ";
|
return "<$priority>1 ";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -32,10 +32,10 @@ class SyslogUdpHandlerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol'));
|
$socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol'));
|
||||||
$socket->expects($this->at(0))
|
$socket->expects($this->at(0))
|
||||||
->method('write')
|
->method('write')
|
||||||
->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">: ");
|
->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 ");
|
||||||
$socket->expects($this->at(1))
|
$socket->expects($this->at(1))
|
||||||
->method('write')
|
->method('write')
|
||||||
->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">: ");
|
->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 ");
|
||||||
|
|
||||||
$handler->setSocket($socket);
|
$handler->setSocket($socket);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user