mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
Fixes php8 non-backward compatible changes (#1568)
* Utils method added to resolve PCRE error messages properly
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Monolog\Handler;
|
||||
use DateTimeInterface;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\SyslogUdp\UdpSocket;
|
||||
use Monolog\Utils;
|
||||
|
||||
/**
|
||||
* A Handler for logging to a remote syslogd server.
|
||||
@@ -89,7 +90,8 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
|
||||
$lines = preg_split('/$\R?^/m', (string) $message, -1, PREG_SPLIT_NO_EMPTY);
|
||||
if (false === $lines) {
|
||||
throw new \RuntimeException('Could not preg_split: '.preg_last_error().' / '.preg_last_error_msg());
|
||||
$pcreErrorCode = preg_last_error();
|
||||
throw new \RuntimeException('Could not preg_split: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode));
|
||||
}
|
||||
|
||||
return $lines;
|
||||
|
Reference in New Issue
Block a user