MediaWiki master
|
Write logs to a syslog server, using RFC 3164 formatted UDP packets. More...
Inherits SyslogUdpHandler.
Public Member Functions | |
__construct ( $appname, $host, $port=514, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true) | |
Protected Member Functions | |
makeCommonSyslogHeader (int $severity, DateTimeInterface $datetime) | |
Write logs to a syslog server, using RFC 3164 formatted UDP packets.
This builds on Monolog's SyslogUdpHandler, which creates only a partial RFC 5424 header (PRI and VERSION), with rest intending to come from a specifically configured LineFormatter.
This makes use of SyslogUdpHandler it impossible with a formatter like \Monolog\Formatter\LogstashFormatter. Additionally, the direct syslog input for Logstash requires and accepts only RFC 3164 formatted packets.
This is a complete syslog handler and should work with any formatter. The formatted message will be prepended with a complete RFC 3164 message header and a partial message body. The resulting packet looks 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 51 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 66 of file SyslogHandler.php.
|
protected |
Definition at line 79 of file SyslogHandler.php.