|
MediaWiki master
|
Monolog imitation of MediaWiki\Logger\LegacyLogger. More...
Inherits AbstractProcessingHandler.

Public Member Functions | |
| __construct ( $stream, $useLegacyFilter=false, $level=Logger::DEBUG, $bubble=true) | |
| close () | |
Protected Member Functions | |
| errorTrap ( $code, $msg) | |
| Custom error handler. | |
| openSink () | |
| Open the log sink described by our stream URI. | |
| useUdp () | |
| Should we use UDP to send messages to the sink? | |
| write (array $record) | |
Protected Attributes | |
| string null | $error |
| string | $host |
| int | $port |
| string | $prefix |
| Socket resource null | $sink |
| Log sink. | |
| string | $uri |
| Log sink descriptor. | |
| bool | $useLegacyFilter |
| Filter log events using legacy rules. | |
Monolog imitation of MediaWiki\Logger\LegacyLogger.
This replicates the behavior of LegacyLogger, which in turn replicates MediaWiki's former wfErrorLog() function.
The main use case of the LegacyHandler is to enable adoption of Monolog features (such as alternate formatters, extra processors, and enabling multiple destinations/handlers at the same time), where one of the handlers (this one) essentiallly does what the LegacySpi would do if you hadn't enabled MonologSpi. In particular: writing to a file like $wgDebugLogFile, and sending messages to a PHP stream or udp2log server.
For udp2log output, the stream specification must have the form: "udp://HOST:PORT[/PREFIX]" where:
When not targeting a udp2log server, this class will act as a drop-in replacement for \Monolog\Handler\StreamHandler.
Definition at line 46 of file LegacyHandler.php.
| MediaWiki\Logger\Monolog\LegacyHandler::__construct | ( | $stream, | |
| $useLegacyFilter = false, | |||
| $level = Logger::DEBUG, | |||
| $bubble = true ) |
| string | $stream | Stream URI |
| bool | $useLegacyFilter | Filter log events using legacy rules |
| int | $level | Minimum logging level that will trigger handler |
| bool | $bubble | Can handled messages bubble up the handler stack? |
Definition at line 92 of file LegacyHandler.php.
References MediaWiki\Logger\Monolog\LegacyHandler\$useLegacyFilter.
| MediaWiki\Logger\Monolog\LegacyHandler::close | ( | ) |
Definition at line 228 of file LegacyHandler.php.
|
protected |
Custom error handler.
| int | $code | Error number |
| string | $msg | Error message |
Definition at line 164 of file LegacyHandler.php.
Referenced by MediaWiki\Logger\Monolog\LegacyHandler\openSink().
|
protected |
Open the log sink described by our stream URI.
Definition at line 106 of file LegacyHandler.php.
References MediaWiki\Logger\Monolog\LegacyHandler\errorTrap().
|
protected |
Should we use UDP to send messages to the sink?
Definition at line 172 of file LegacyHandler.php.
|
protected |
Definition at line 176 of file LegacyHandler.php.
|
protected |
Definition at line 69 of file LegacyHandler.php.
|
protected |
Definition at line 74 of file LegacyHandler.php.
|
protected |
Definition at line 79 of file LegacyHandler.php.
|
protected |
Definition at line 84 of file LegacyHandler.php.
|
protected |
Log sink.
Definition at line 64 of file LegacyHandler.php.
|
protected |
Log sink descriptor.
Definition at line 52 of file LegacyHandler.php.
|
protected |
Filter log events using legacy rules.
Definition at line 58 of file LegacyHandler.php.
Referenced by MediaWiki\Logger\Monolog\LegacyHandler\__construct().