mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 00:56:08 +02:00
Add possibility to pass handlers/processors to Logger::__construct, fixes #157
This commit is contained in:
@@ -99,16 +99,27 @@ class Logger implements LoggerInterface
|
||||
*
|
||||
* @var array of Monolog\Handler\HandlerInterface
|
||||
*/
|
||||
protected $handlers = array();
|
||||
|
||||
protected $processors = array();
|
||||
protected $handlers;
|
||||
|
||||
/**
|
||||
* @param string $name The logging channel
|
||||
* Processors that will process all log records
|
||||
*
|
||||
* To process records of a single handler instead, add the processor on that specific handler
|
||||
*
|
||||
* @var array of callables
|
||||
*/
|
||||
public function __construct($name)
|
||||
protected $processors;
|
||||
|
||||
/**
|
||||
* @param string $name The logging channel
|
||||
* @param array $handlers Optional stack of handlers, the first one in the array is called first, etc.
|
||||
* @param array $processors Optional array of processors
|
||||
*/
|
||||
public function __construct($name, array $handlers = array(), array $processors = array())
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->handlers = $handlers;
|
||||
$this->processors = $processors;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user