MWLoggerFactory implements a PSR-3 [0] compatible message logging system. Named Psr\Log\LoggerInterface instances can be obtained from the MWLoggerFactory::getInstance() static method. MWLoggerFactory expects a class implementing the MWLoggerSpi interface to act as a factory for new Psr\Log\LoggerInterface instances. The "Spi" in MWLoggerSpi stands for "service provider interface". A SPI is an API intended to be implemented or extended by a third party. This software design pattern is intended to enable framework extension and replaceable components. It is specifically used in the MWLoggerFactory service to allow alternate PSR-3 logging implementations to be easily integrated with MediaWiki. The MWLoggerFactory::getInstance() static method is the means by which most code acquires a Psr\Log\LoggerInterface instance. This in turn delegates creation of Psr\Log\LoggerInterface instances to a class implementing the MWLoggerSpi service provider interface. The service provider interface allows the backend logging library to be implemented in multiple ways. The $wgMWLoggerDefaultSpi global provides the classname of the default MWLoggerSpi implementation to be loaded at runtime. This can either be the name of a class implementing the MWLoggerSpi with a zero argument constructor or a callable that will return an MWLoggerSpi instance. Alternately the MWLoggerFactory::registerProvider method can be called to inject an MWLoggerSpi instance into MWLoggerFactory and bypass the use of this configuration variable. The MWLoggerLegacySpi class implements a service provider to generate MWLoggerLegacyLogger instances. The MWLoggerLegacyLogger class implements the PSR-3 logger interface and provides output and configuration equivalent to the historic logging output of wfDebug, wfDebugLog, wfLogDBError and wfErrorLog. The MWLoggerLegacySpi class is the default service provider configured in DefaultSettings.php. It's usage should be transparent for users who are not ready or do not wish to switch to a alternate logging platform. The MWLoggerMonologSpi class implements a service provider to generate Psr\Log\LoggerInterface instances that use the Monolog [1] logging library. See the PHP docs (or source) for MWLoggerMonologSpi for details on the configuration of this provider. The default configuration installs a null handler that will silently discard all logging events. The documentation provided by the class describes a more feature rich logging configuration. == Classes == ; MWLoggerFactory : Factory for Psr\Log\LoggerInterface loggers ; MWLoggerSpi : Service provider interface for MWLoggerFactory ; MWLoggerNullSpi : MWLoggerSpi for creating instances that discard all log events ; MWLoggerLegacySpi : Service provider for creating MWLoggerLegacyLogger instances ; MWLoggerLegacyLogger : PSR-3 logger that mimics the historical output and configuration of wfDebug, wfErrorLog and other global logging functions. ; MWLoggerMonologSpi : MWLoggerSpi for creating instances backed by the monolog logging library ; MwLoggerMonologHandler : Monolog handler that replicates the udp2log and file logging functionality of wfErrorLog() ; MwLoggerMonologProcessor : Monolog log processer that adds host: wfHostname() and wiki: wfWikiID() to all records == Globals == ; $wgMWLoggerDefaultSpi : Specification for creating the default service provider interface to use with MWLoggerFactory [0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md [1]: https://github.com/Seldaek/monolog