PHP Class Cascade\Config\Loader\ClassLoader\LoggerLoader

See also: ClassLoader
Author: Raphael Antonmattei ([email protected])
Show file Open project: theorchard/monolog-cascade Class Usage Examples

Protected Properties

Property Type Description
$handlers Monolog\Handler\HandlerInterface[] Array of handlers
$logger Monolog\Logger Logger
$loggerOptions array Array of options
$processors callable[] Array of processors

Public Methods

Method Description
__construct ( string $loggerName, array $loggerOptions = [], array $handlers = [], array $processors = [] ) Constructor
load ( ) : Monolog\Logger Return the instantiated Logger object based on its name
resolveHandlers ( array $loggerOptions, array $handlers ) : Monolog\Handler\HandlerInterface[] Resolve handlers for that Logger (if any provided) against an array of previously set up handlers. Returns an array of valid handlers.
resolveProcessors ( array $loggerOptions, callable[] $processors ) : callable[] Resolve processors for that Logger (if any provided) against an array of previously set up processors.

Private Methods

Method Description
addHandlers ( array $handlers ) Add handlers to the Logger
addProcessors ( array $processors ) Add processors to the Logger

Method Details

__construct() public method

Constructor
public __construct ( string $loggerName, array $loggerOptions = [], array $handlers = [], array $processors = [] )
$loggerName string Name of the logger
$loggerOptions array Array of logger options
$handlers array Array of Monolog handlers
$processors array Array of processors

load() public method

Return the instantiated Logger object based on its name
public load ( ) : Monolog\Logger
return Monolog\Logger Logger object

resolveHandlers() public method

Resolve handlers for that Logger (if any provided) against an array of previously set up handlers. Returns an array of valid handlers.
public resolveHandlers ( array $loggerOptions, array $handlers ) : Monolog\Handler\HandlerInterface[]
$loggerOptions array Array of logger options
$handlers array Available Handlers to resolve against
return Monolog\Handler\HandlerInterface[] Array of Monolog handlers

resolveProcessors() public method

Resolve processors for that Logger (if any provided) against an array of previously set up processors.
public resolveProcessors ( array $loggerOptions, callable[] $processors ) : callable[]
$loggerOptions array Array of logger options
$processors callable[] Available Processors to resolve against
return callable[] Array of Monolog processors

Property Details

$handlers protected property

Array of handlers
protected Monolog\Handler\HandlerInterface[] $handlers
return Monolog\Handler\HandlerInterface[]

$logger protected property

Logger
protected Monolog\Logger $logger
return Monolog\Logger

$loggerOptions protected property

Array of options
protected array $loggerOptions
return array

$processors protected property

Array of processors
protected callable[] $processors
return callable[]