BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
MediaWiki\Logger\Monolog\LegacyHandler Class Reference
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 ()
 
- Public Member Functions inherited from Monolog\Handler\AbstractProcessingHandler
 handle (array $record)
 
- Public Member Functions inherited from Monolog\Handler\AbstractHandler
 __construct ($level=Logger::DEBUG, $bubble=true)
 
 isHandling (array $record)
 
 handleBatch (array $records)
 
 close ()
 
 pushProcessor ($callback)
 
 popProcessor ()
 
 setFormatter (FormatterInterface $formatter)
 
 getFormatter ()
 
 setLevel ($level)
 
 getLevel ()
 
 setBubble ($bubble)
 
 getBubble ()
 

Protected Member Functions

 openSink ()
 
 errorTrap ($code, $msg)
 
 useUdp ()
 
 write (array $record)
 
- Protected Member Functions inherited from Monolog\Handler\AbstractProcessingHandler
 write (array $record)
 
 processRecord (array $record)
 
- Protected Member Functions inherited from Monolog\Handler\AbstractHandler
 getDefaultFormatter ()
 

Protected Attributes

 $uri
 
 $useLegacyFilter
 
 $sink
 
 $error
 
 $host
 
 $port
 
 $prefix
 
- Protected Attributes inherited from Monolog\Handler\AbstractHandler
 $level = Logger::DEBUG
 
 $bubble = true
 
 $formatter
 
 $processors = array()
 

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 .

Since
1.25

Constructor & Destructor Documentation

MediaWiki\Logger\Monolog\LegacyHandler::__construct (   $stream,
  $useLegacyFilter = false,
  $level = Logger::DEBUG,
  $bubble = true 
)
Parameters
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?

Member Function Documentation

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

Custom error handler.

Parameters
int$codeError number
string$msgError message
MediaWiki\Logger\Monolog\LegacyHandler::openSink ( )
protected

Open the log sink described by our stream URI.

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

Should we use UDP to send messages to the sink?

Returns
bool

Member Data Documentation

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

Log sink

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

Log sink descriptor

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

Filter log events using legacy rules


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