MediaWiki  1.28.1
MediaWiki\Logger\Monolog\LegacyHandler Class Reference

Log handler that replicates the behavior of MediaWiki's wfErrorLog() logging service. More...

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

Public Member Functions

 __construct ($stream, $useLegacyFilter=false, $level=Logger::DEBUG, $bubble=true)
 close ()

Protected Member Functions

 errorTrap ($code, $msg)
 Custom error handler. More...
 openSink ()
 Open the log sink described by our stream URI. More...
 useUdp ()
 Should we use UDP to send messages to the sink? More...
 write (array $record)

Protected Attributes

 Log sink. More...
 Log sink descriptor. More...
 Filter log events using legacy rules. More...

Detailed Description

Log handler that replicates the behavior of MediaWiki's wfErrorLog() logging service.

Log output can be directed to a local file, a PHP stream, or a udp2log server.

For udp2log output, the stream specification must have the form: "udp://HOST:PORT[/PREFIX]" where:

  • HOST: IPv4, IPv6 or hostname
  • PORT: server port
  • PREFIX: optional (but recommended) prefix telling udp2log how to route the log event. The special prefix "{channel}" will use the log event's channel as the prefix value.

When not targeting a udp2log stream this class will act as a drop-in replacement for \Monolog\Handler\StreamHandler.

Bryan Davis bd808.nosp@m.@wik.nosp@m.imedi.nosp@m.a.or.nosp@m.g
© 2013 Bryan Davis and Wikimedia Foundation.

Definition at line 50 of file LegacyHandler.php.

Constructor & Destructor Documentation

MediaWiki\Logger\Monolog\LegacyHandler::__construct (   $stream,
  $useLegacyFilter = false,
  $level = Logger::DEBUG,
  $bubble = true 
string$streamStream URI
bool$useLegacyFilterFilter log events using legacy rules
int$levelMinimum logging level that will trigger handler
bool$bubbleCan handled meesages bubble up the handler stack?

Definition at line 96 of file LegacyHandler.php.

References MediaWiki\Logger\Monolog\LegacyHandler\$useLegacyFilter.

Member Function Documentation

MediaWiki\Logger\Monolog\LegacyHandler::close ( )
MediaWiki\Logger\Monolog\LegacyHandler::errorTrap (   $code,

Custom error handler.

int$codeError number
string$msgError message

Definition at line 167 of file LegacyHandler.php.

MediaWiki\Logger\Monolog\LegacyHandler::openSink ( )

Open the log sink described by our stream URI.

Definition at line 110 of file LegacyHandler.php.

References port().

Referenced by MediaWiki\Logger\Monolog\LegacyHandler\write().

MediaWiki\Logger\Monolog\LegacyHandler::useUdp ( )

Should we use UDP to send messages to the sink?


Definition at line 175 of file LegacyHandler.php.

Referenced by MediaWiki\Logger\Monolog\LegacyHandler\close(), and MediaWiki\Logger\Monolog\LegacyHandler\write().

MediaWiki\Logger\Monolog\LegacyHandler::write ( array  $record)

Member Data Documentation

string MediaWiki\Logger\Monolog\LegacyHandler::$error

Definition at line 73 of file LegacyHandler.php.

string MediaWiki\Logger\Monolog\LegacyHandler::$host

Definition at line 78 of file LegacyHandler.php.

int MediaWiki\Logger\Monolog\LegacyHandler::$port

Definition at line 83 of file LegacyHandler.php.

string MediaWiki\Logger\Monolog\LegacyHandler::$prefix

Definition at line 88 of file LegacyHandler.php.

resource MediaWiki\Logger\Monolog\LegacyHandler::$sink

Log sink.

Definition at line 68 of file LegacyHandler.php.

string MediaWiki\Logger\Monolog\LegacyHandler::$uri

Log sink descriptor.

Definition at line 56 of file LegacyHandler.php.

bool MediaWiki\Logger\Monolog\LegacyHandler::$useLegacyFilter

Filter log events using legacy rules.

Definition at line 62 of file LegacyHandler.php.

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

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