1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 13:16:39 +02:00

Merge pull request #472 from danmichaelo/master

SyslogUdpHandler: Send a valid rfc5424 version
This commit is contained in:
Jordi Boggiano
2014-12-28 16:29:00 +00:00
2 changed files with 4 additions and 4 deletions

View File

@@ -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 ";
} }
/** /**

View File

@@ -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);