23use Monolog\Handler\SyslogUdpHandler;
74 $level = Logger::DEBUG,
77 parent::__construct( $host, $port, $facility, $level, $bubble );
78 $this->appprefix = $appprefix;
79 $this->hostname = php_uname(
'n' );
83 $pri = $severity + $this->facility;
89 $timestamp = date(
'M j H:i:s' );
91 return "<{$pri}>{$timestamp} {$this->hostname} {$app}: ";
94 private function splitMessageIntoLines( $message ): array {
95 if ( is_array( $message ) ) {
96 $message = implode(
"\n", $message );
99 return preg_split(
'/$\R?^/m', (
string)$message, -1, PREG_SPLIT_NO_EMPTY );
102 protected function write( array $record ): void {
103 $lines = $this->splitMessageIntoLines( $record[
'formatted'] );
105 $this->logLevels[$record[
'level']],
106 $this->appprefix . $record[
'channel'] );
108 foreach (
$lines as $line ) {
109 $this->socket->write( $line,
$header );
if(!defined('MW_SETUP_CALLBACK'))
if(!file_exists( $CREDITS)) $lines