LoggerFactory
extends Horde_Core_Factory_Injector
in package
LoggerFactory builds modular loggers with multiple handlers
Table of Contents
Properties
- $_injector : Horde_Injector
- The injector.
- $conf : State
- $handlerFactory : LogHandlerFactory
- $handlers : array<string|int, LogHandler>
- Keyed list of handlers, to prevent doubles
- $levels : LogLevels
- $logger : Logger
Methods
- __construct() : mixed
- Constructor
- create() : Logger
- Create default logger
- predefinedHandlers() : array<string|int, LogHandler>
- Integration point
- _getDriverName() : string
- Return the classname of the driver to load.
Properties
$_injector
The injector.
protected
Horde_Injector
$_injector
$conf
private
State
$conf
$handlerFactory
private
LogHandlerFactory
$handlerFactory
$handlers
Keyed list of handlers, to prevent doubles
private
array<string|int, LogHandler>
$handlers
= []
$levels
private
LogLevels
$levels
$logger
private
Logger
$logger
Methods
__construct()
Constructor
public
__construct(State $config, LogHandlerFactory $handlerFactory) : mixed
Parameters
- $config : State
-
The conf.php values for the global log handler
- $handlerFactory : LogHandlerFactory
create()
Create default logger
public
create(Injector $injector) : Logger
This creates a logger with
- one handler based on the horde config or no handler,
- canonic log levels,
- the PSR-3 formatter and depending on options, another formatter,
- a handler-level filter by loglevel
TODO: Mechanism to add specialised handlers without a configuration mess.
Parameters
- $injector : Injector
Tags
Return values
LoggerpredefinedHandlers()
Integration point
public
predefinedHandlers() : array<string|int, LogHandler>
Return values
array<string|int, LogHandler>_getDriverName()
Return the classname of the driver to load.
protected
_getDriverName(string $driver, string $base) : string
Parameters
- $driver : string
-
Driver name.
- $base : string
-
The base classname.
Tags
Return values
string —Classname.