MediaWiki REL1_33
MediaWiki\Logger\Monolog\MwlogHandler Class Reference

Log handler that will append the record's channel to a fixed 'application prefix' given at construction time. More...

Inheritance diagram for MediaWiki\Logger\Monolog\MwlogHandler:
Collaboration diagram for MediaWiki\Logger\Monolog\MwlogHandler:

Public Member Functions

 __construct ( $appprefix, $host, $port=514, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true)
 

Protected Member Functions

 syslogHeader ( $severity, $app)
 
 write (array $record)
 

Private Member Functions

 splitMessageIntoLines ( $message)
 

Private Attributes

 $appprefix
 
 $hostname
 

Detailed Description

Log handler that will append the record's channel to a fixed 'application prefix' given at construction time.

The use case for this handler is to deprecate udp2log with a localhost syslog endpoint. The application name is then used to reconstruct the message's channel.

Since
1.32
Note
© 2019 Wikimedia Foundation and contributors

Definition at line 37 of file MwlogHandler.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Logger\Monolog\MwlogHandler::__construct ( $appprefix,
$host,
$port = 514,
$facility = LOG_USER,
$level = Logger::DEBUG,
$bubble = true )
Parameters
string$appprefixApplication prefix to use, channel will be appended.
string$hostSyslog host
int$portSyslog port
int$facilitySyslog message facility
int$levelThe minimum logging level at which this handler will be triggered
bool$bubbleWhether the messages that are handled can bubble up the stack or not

Definition at line 59 of file MwlogHandler.php.

References MediaWiki\Logger\Monolog\MwlogHandler\$appprefix, and and().

Member Function Documentation

◆ splitMessageIntoLines()

MediaWiki\Logger\Monolog\MwlogHandler::splitMessageIntoLines ( $message)
private

Definition at line 84 of file MwlogHandler.php.

◆ syslogHeader()

MediaWiki\Logger\Monolog\MwlogHandler::syslogHeader ( $severity,
$app )
protected

Definition at line 72 of file MwlogHandler.php.

References and().

◆ write()

MediaWiki\Logger\Monolog\MwlogHandler::write ( array $record)
protected

Definition at line 92 of file MwlogHandler.php.

References $header, $line, and $lines.

Member Data Documentation

◆ $appprefix

string MediaWiki\Logger\Monolog\MwlogHandler::$appprefix
private

Definition at line 42 of file MwlogHandler.php.

Referenced by MediaWiki\Logger\Monolog\MwlogHandler\__construct().

◆ $hostname

string MediaWiki\Logger\Monolog\MwlogHandler::$hostname
private

Definition at line 47 of file MwlogHandler.php.


The documentation for this class was generated from the following file: