23use Monolog\Handler\SyslogUdpHandler;
64 $level = Logger::DEBUG,
67 parent::__construct( $host, $port, $facility, $level, $bubble );
68 $this->appprefix = $appprefix;
69 $this->hostname = php_uname(
'n' );
73 $pri = $severity + $this->facility;
79 $timestamp = date(
'M j H:i:s' );
81 return "<{$pri}>{$timestamp} {$this->hostname} {$app}: ";
84 private function splitMessageIntoLines( $message ): array {
85 if ( is_array( $message ) ) {
86 $message = implode(
"\n", $message );
89 return preg_split(
'/$\R?^/m', (
string)$message, -1, PREG_SPLIT_NO_EMPTY );
92 protected function write( array $record ): void {
93 $lines = $this->splitMessageIntoLines( $record[
'formatted'] );
95 $this->logLevels[$record[
'level']],
96 $this->appprefix . $record[
'channel'] );
if(!defined('MW_SETUP_CALLBACK'))
The persistent session ID (if any) loaded at startup.
if(!file_exists( $CREDITS)) $lines