mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 04:07:39 +02:00
Merge pull request #1572 from mimmi20/main
add check for required extension
This commit is contained in:
@@ -49,11 +49,16 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
|||||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
* @param string $ident Program name or tag for each log message.
|
* @param string $ident Program name or tag for each log message.
|
||||||
* @param int $rfc RFC to format the message for.
|
* @param int $rfc RFC to format the message for.
|
||||||
|
* @throws MissingExtensionException
|
||||||
*
|
*
|
||||||
* @phpstan-param self::RFC* $rfc
|
* @phpstan-param self::RFC* $rfc
|
||||||
*/
|
*/
|
||||||
public function __construct(string $host, int $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, string $ident = 'php', int $rfc = self::RFC5424)
|
public function __construct(string $host, int $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, string $ident = 'php', int $rfc = self::RFC5424)
|
||||||
{
|
{
|
||||||
|
if (!extension_loaded('sockets')) {
|
||||||
|
throw new MissingExtensionException('The sockets extension is required to use the SyslogUdpHandler');
|
||||||
|
}
|
||||||
|
|
||||||
parent::__construct($facility, $level, $bubble);
|
parent::__construct($facility, $level, $bubble);
|
||||||
|
|
||||||
$this->ident = $ident;
|
$this->ident = $ident;
|
||||||
|
Reference in New Issue
Block a user