MediaWiki REL1_35
|
Log handler that supports sending log events to a syslog server using RFC 3164 formatted UDP packets. More...
Public Member Functions | |
__construct ( $appname, $host, $port=514, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true) | |
Protected Member Functions | |
makeCommonSyslogHeader (int $severity, DateTimeInterface $datetime) | |
Private Attributes | |
string | $appname |
string | $hostname |
Log handler that supports sending log events to a syslog server using RFC 3164 formatted UDP packets.
Monolog's SyslogUdpHandler creates a partial RFC 5424 header (PRI and VERSION) and relies on the associated formatter to complete the header and message payload. This makes using it with a fixed format formatter like \Monolog\Formatter\LogstashFormatter impossible. Additionally, the direct syslog input for Logstash only handles RFC 3164 syslog packets.
This Handler should work with any Formatter. The formatted message will be prepended with an RFC 3164 message header and a partial message body. The resulting packet will looks something like:
<PRI>DATETIME HOSTNAME PROGRAM: MESSAGE
This format works as input to rsyslog and can also be processed by the default Logstash syslog input handler.
Definition at line 49 of file SyslogHandler.php.
MediaWiki\Logger\Monolog\SyslogHandler::__construct | ( | $appname, | |
$host, | |||
$port = 514 , |
|||
$facility = LOG_USER , |
|||
$level = Logger::DEBUG , |
|||
$bubble = true |
|||
) |
string | $appname | Application name to report to syslog |
string | $host | Syslog host |
int | $port | Syslog port |
int | $facility | Syslog message facility |
int | $level | The minimum logging level at which this handler will be triggered |
bool | $bubble | Whether the messages that are handled can bubble up the stack or not |
Definition at line 71 of file SyslogHandler.php.
References MediaWiki\Logger\Monolog\SyslogHandler\$appname.
|
protected |
Definition at line 84 of file SyslogHandler.php.
|
private |
Definition at line 54 of file SyslogHandler.php.
Referenced by MediaWiki\Logger\Monolog\SyslogHandler\__construct().
|
private |
Definition at line 59 of file SyslogHandler.php.