MediaWiki
1.32.5
|
PSR-3 logger instance factory. More...
Static Public Member Functions | |
static | getInstance ( $channel) |
Get a named logger instance from the currently configured logger factory. More... | |
static | getProvider () |
Get the registered service provider. More... | |
static | registerProvider (Spi $provider) |
Register a service provider to create new \Psr\Log\LoggerInterface instances. More... | |
Private Member Functions | |
__construct () | |
Construction of utility class is not allowed. More... | |
Static Private Attributes | |
static | $spi |
Service provider. More... | |
PSR-3 logger instance factory.
Creation of \Psr\Log\LoggerInterface instances is managed via the LoggerFactory::getInstance() static method which in turn delegates to the currently registered service provider.
A service provider is any class implementing the Spi interface. There are two possible methods of registering a service provider. The LoggerFactory::registerProvider() static method can be called at any time to change the service provider. If LoggerFactory::getInstance() is called before any service provider has been registered, it will attempt to use the $wgMWLoggerDefaultSpi global to bootstrap Spi registration. $wgMWLoggerDefaultSpi is expected to be an array usable by ObjectFactory::getObjectFromSpec() to create a class.
Definition at line 45 of file LoggerFactory.php.
|
private |
Construction of utility class is not allowed.
Definition at line 99 of file LoggerFactory.php.
|
static |
Get a named logger instance from the currently configured logger factory.
string | $channel | Logger channel (name) |
Definition at line 92 of file LoggerFactory.php.
References MediaWiki\Logger\LoggerFactory\getProvider().
Referenced by MediaWiki\Auth\AuthManagerAuthPlugin\__construct(), JobQueueAggregatorRedis\__construct(), MediaWiki\Auth\Throttler\__construct(), PoolCounterRedis\__construct(), JobQueueRedis\__construct(), MediaWiki\Auth\AuthManager\__construct(), MediaWiki\HeaderCallback\callback(), User\checkPassword(), MediaWiki\Http\HttpRequestFactory\create(), User\doLogout(), PoolWorkArticleView\doWork(), ApiLogin\execute(), MediaWiki\Logger\Monolog\KafkaHandler\factory(), User\load(), User\setCookies(), User\setPasswordInternal(), User\setToken(), MediaWiki\Tests\Storage\NameTableStoreFactoryTest\testGet(), and MediaWiki\HeaderCallback\warnIfHeadersSent().
|
static |
Get the registered service provider.
If called before any service provider has been registered, it will attempt to use the $wgMWLoggerDefaultSpi global to bootstrap Spi registration. $wgMWLoggerDefaultSpi is expected to be an array usable by ObjectFactory::getObjectFromSpec() to create a class.
Definition at line 75 of file LoggerFactory.php.
References MediaWiki\Logger\LoggerFactory\$spi, $wgMWLoggerDefaultSpi, and MediaWiki\Logger\LoggerFactory\registerProvider().
Referenced by MediaWiki\Logger\LoggerFactory\getInstance().
|
static |
Register a service provider to create new \Psr\Log\LoggerInterface instances.
\\MediaWiki\\Logger\\Spi | $provider | Provider to register |
Definition at line 59 of file LoggerFactory.php.
Referenced by MediaWiki\Logger\LoggerFactory\getProvider().
Service provider.
Definition at line 51 of file LoggerFactory.php.
Referenced by MediaWiki\Logger\LoggerFactory\getProvider().