Merge "Fixed Style/HashSyntax RuboCop offense"
[lhc/web/wiklou.git] / docs / mwlogger.txt
index 9964e8b..ecc3626 100644 (file)
@@ -1,44 +1,58 @@
-MWLogger implements a PSR-3 [0] compatible message logging system.
+MWLoggerFactory implements a PSR-3 [0] compatible message logging system.
 
-The MWLogger class is actually a thin wrapper around any PSR-3 LoggerInterface
-implementation. Named MWLogger instances can be obtained from the
-MWLogger::getInstance() static method. MWLogger expects a class implementing
-the MWLoggerSpi interface to act as a factory for new MWLogger instances.
+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". An SPI is
-a API intended to be implemented or extended by a third party. This software
+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 MWLogger service to allow alternate
-PSR-3 logging implementations to be easily integrated with MediaWiki.
+components. It is specifically used in the MWLoggerFactory service to allow
+alternate PSR-3 logging implementations to be easily integrated with
+MediaWiki.
 
-The MWLogger::getInstance() static method is the means by which most code
-acquires an MWLogger instance. This in turn delegates creation of MWLogger
-instances to a class implementing the MWLoggerSpi service provider interface.
+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 MWLogger::registerProvider method can be called
-to inject an MWLoggerSpi instance into MWLogger and bypass the use of this
-configuration variable.
+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
-MWLogger 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.
+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 ==
-; MWLogger
-: PSR-3 compatible logger that wraps any \Psr\Log\LoggerInterface
-  implementation
+; MWLoggerFactory
+: Factory for Psr\Log\LoggerInterface loggers
 ; MWLoggerSpi
-: Service provider interface for MWLogger factories
+: 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
@@ -50,10 +64,8 @@ a more feature rich logging configuration.
 
 == Globals ==
 ; $wgMWLoggerDefaultSpi
-: Default service provider interface to use with MWLogger
-; $wgMWLoggerMonologSpiConfig
-: Configuration for MWLoggerMonologSpi describing how to configure the
-  Monolog logger instances.
+: 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