MediaWiki REL1_32
|
LoggerFactory service provider that creates loggers implemented by Monolog. More...
Public Member Functions | |
__construct (array $config) | |
getFormatter ( $name) | |
Create or return cached formatter. | |
getHandler ( $name) | |
Create or return cached handler. | |
getLogger ( $channel) | |
Get a logger instance. | |
getProcessor ( $name) | |
Create or return cached processor. | |
mergeConfig (array $config) | |
Merge additional configuration data into the configuration. | |
reset () | |
Reset internal caches. | |
Protected Member Functions | |
createLogger ( $channel, $spec) | |
Create a logger. | |
Protected Attributes | |
$config | |
Configuration for creating new loggers. | |
$singletons | |
LoggerFactory service provider that creates loggers implemented by Monolog.
Configured using an array of configuration data with the keys 'loggers', 'processors', 'handlers' and 'formatters'.
The ['loggers']['\@default'] configuration will be used to create loggers for any channel that isn't explicitly named in the 'loggers' configuration section.
Configuration will most typically be provided in the $wgMWLoggerDefaultSpi global configuration variable used by LoggerFactory to construct its default SPI provider:
Definition at line 115 of file MonologSpi.php.
MediaWiki\Logger\MonologSpi::__construct | ( | array | $config | ) |
array | $config | Configuration data. |
Definition at line 131 of file MonologSpi.php.
References MediaWiki\Logger\MonologSpi\mergeConfig().
|
protected |
Create a logger.
string | $channel | Logger channel |
array | $spec | Configuration |
Definition at line 197 of file MonologSpi.php.
References $handler, as, MediaWiki\Logger\MonologSpi\getHandler(), and MediaWiki\Logger\MonologSpi\getProcessor().
Referenced by MediaWiki\Logger\MonologSpi\getLogger().
MediaWiki\Logger\MonologSpi::getFormatter | ( | $name | ) |
Create or return cached formatter.
string | $name | Formatter name |
Definition at line 261 of file MonologSpi.php.
References $name.
Referenced by MediaWiki\Logger\MonologSpi\getHandler().
MediaWiki\Logger\MonologSpi::getHandler | ( | $name | ) |
Create or return cached handler.
string | $name | Processor name |
Definition at line 239 of file MonologSpi.php.
References $handler, $name, and MediaWiki\Logger\MonologSpi\getFormatter().
Referenced by MediaWiki\Logger\MonologSpi\createLogger().
MediaWiki\Logger\MonologSpi::getLogger | ( | $channel | ) |
Get a logger instance.
Creates and caches a logger instance based on configuration found in the $wgMWLoggerMonologSpiConfig global. Subsequent request for the same channel name will return the cached instance.
string | $channel | Logging channel |
Implements MediaWiki\Logger\Spi.
Definition at line 178 of file MonologSpi.php.
References MediaWiki\Logger\MonologSpi\createLogger().
MediaWiki\Logger\MonologSpi::getProcessor | ( | $name | ) |
Create or return cached processor.
string | $name | Processor name |
Definition at line 225 of file MonologSpi.php.
References $name.
Referenced by MediaWiki\Logger\MonologSpi\createLogger().
MediaWiki\Logger\MonologSpi::mergeConfig | ( | array | $config | ) |
Merge additional configuration data into the configuration.
array | $config | Configuration data. |
Definition at line 142 of file MonologSpi.php.
References MediaWiki\Logger\MonologSpi\$config, $value, as, and MediaWiki\Logger\MonologSpi\reset().
Referenced by MediaWiki\Logger\MonologSpi\__construct().
MediaWiki\Logger\MonologSpi::reset | ( | ) |
Reset internal caches.
This is public for use in unit tests. Under normal operation there should be no need to flush the caches.
Definition at line 159 of file MonologSpi.php.
Referenced by MediaWiki\Logger\MonologSpi\mergeConfig().
|
protected |
Configuration for creating new loggers.
Definition at line 126 of file MonologSpi.php.
Referenced by MediaWiki\Logger\MonologSpi\mergeConfig().
|
protected |
Definition at line 120 of file MonologSpi.php.