ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
This simple wrapper class can be used to extend handlers functionality. More...
Public Member Functions | ||||
__construct (HandlerInterface $handler) | ||||
HandlerWrapper constructor. More... | ||||
isHandling (array $record) | ||||
{Checks whether the given record will be handled by this handler.This is mostly done for performance reasons, to avoid calling processors for nothing.Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.
| ||||
handle (array $record) | ||||
{Handles a record.All records may be passed to this method, and the handler should discard those that it does not want to handle.The return value of this function controls the bubbling process of the handler stack. Unless the bubbling is interrupted (by returning true), the Logger class will keep on calling further handlers in the stack with a given log record.
| ||||
handleBatch (array $records) | ||||
{Handles a set of records at once.
| ||||
pushProcessor ($callback) | ||||
{Adds a processor in the stack.
| ||||
popProcessor () | ||||
{Removes the processor on top of the stack and returns it.
| ||||
setFormatter (FormatterInterface $formatter) | ||||
{Sets the formatter.
| ||||
getFormatter () | ||||
{Gets the formatter.
| ||||
reset () | ||||
Protected Attributes | |
$handler | |
This simple wrapper class can be used to extend handlers functionality.
Example: A custom filtering that can be applied to any handler.
Inherit from this class and override handle() like this:
public function handle(array $record) { if ($record meets certain conditions) { return false; } return $this->handler->handle($record); }
Definition at line 34 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::__construct | ( | HandlerInterface | $handler | ) |
HandlerWrapper constructor.
HandlerInterface | $handler |
Definition at line 45 of file HandlerWrapper.php.
References Monolog\Handler\HandlerWrapper\$handler.
Monolog\Handler\HandlerWrapper::getFormatter | ( | ) |
{Gets the formatter.
Implements Monolog\Handler\HandlerInterface.
Definition at line 105 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::handle | ( | array | $record | ) |
{Handles a record.All records may be passed to this method, and the handler should discard those that it does not want to handle.The return value of this function controls the bubbling process of the handler stack. Unless the bubbling is interrupted (by returning true), the Logger class will keep on calling further handlers in the stack with a given log record.
array | $record | The record to handle |
Implements Monolog\Handler\HandlerInterface.
Definition at line 61 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::handleBatch | ( | array | $records | ) |
{Handles a set of records at once.
array | $records | The records to handle (an array of record arrays) |
Implements Monolog\Handler\HandlerInterface.
Definition at line 69 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::isHandling | ( | array | $record | ) |
{Checks whether the given record will be handled by this handler.This is mostly done for performance reasons, to avoid calling processors for nothing.Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.
array | $record | Partial log record containing only a level key |
Implements Monolog\Handler\HandlerInterface.
Definition at line 53 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::popProcessor | ( | ) |
{Removes the processor on top of the stack and returns it.
Implements Monolog\Handler\HandlerInterface.
Definition at line 87 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::pushProcessor | ( | $callback | ) |
{Adds a processor in the stack.
callable | $callback |
Implements Monolog\Handler\HandlerInterface.
Definition at line 77 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::reset | ( | ) |
Implements Monolog\ResettableInterface.
Definition at line 110 of file HandlerWrapper.php.
Monolog\Handler\HandlerWrapper::setFormatter | ( | FormatterInterface | $formatter | ) |
{Sets the formatter.
FormatterInterface | $formatter |
Implements Monolog\Handler\HandlerInterface.
Definition at line 95 of file HandlerWrapper.php.
|
protected |
Definition at line 39 of file HandlerWrapper.php.
Referenced by Monolog\Handler\HandlerWrapper\__construct().