ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Sampling handler. More...
Public Member Functions | ||||
__construct ($handler, $factor) | ||||
isHandling (array $record) | ||||
Checks whether the given record will be handled by this handler. More... | ||||
handle (array $record) | ||||
Handles a record. More... | ||||
Public Member Functions inherited from Monolog\Handler\AbstractHandler | ||||
__construct ($level=Logger::DEBUG, $bubble=true) | ||||
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.
| ||||
handleBatch (array $records) | ||||
{Handles a set of records at once.
| ||||
close () | ||||
Closes the handler. More... | ||||
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.
| ||||
setLevel ($level) | ||||
Sets minimum logging level at which this handler will be triggered. More... | ||||
getLevel () | ||||
Gets minimum logging level at which this handler will be triggered. More... | ||||
setBubble ($bubble) | ||||
Sets the bubbling behavior. More... | ||||
getBubble () | ||||
Gets the bubbling behavior. More... | ||||
__destruct () | ||||
Protected Attributes | |
$handler | |
$factor | |
Protected Attributes inherited from Monolog\Handler\AbstractHandler | |
$level = Logger::DEBUG | |
$bubble = true | |
$formatter | |
$processors = array() | |
Additional Inherited Members | |
Protected Member Functions inherited from Monolog\Handler\AbstractHandler | |
getDefaultFormatter () | |
Gets the default formatter. More... | |
Sampling handler.
A sampled event stream can be useful for logging high frequency events in a production environment where you only need an idea of what is happening and are not concerned with capturing every occurrence. Since the decision to handle or not handle a particular event is determined randomly, the resulting sampled log is not guaranteed to contain 1/N of the events that occurred in the application, but based on the Law of large numbers, it will tend to be close to this ratio with a large number of attempts.
Definition at line 28 of file SamplingHandler.php.
Monolog\Handler\SamplingHandler::__construct | ( | $handler, | |
$factor | |||
) |
callable | HandlerInterface | $handler | Handler or factory callable($record, $fingersCrossedHandler). |
int | $factor | Sample factor |
Definition at line 44 of file SamplingHandler.php.
References Monolog\Handler\SamplingHandler\$factor, and Monolog\Handler\SamplingHandler\$handler.
Monolog\Handler\SamplingHandler::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 60 of file SamplingHandler.php.
References Monolog\Handler\AbstractHandler\$bubble, and Monolog\Handler\SamplingHandler\isHandling().
Monolog\Handler\SamplingHandler::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 55 of file SamplingHandler.php.
Referenced by Monolog\Handler\SamplingHandler\handle().
|
protected |
Definition at line 38 of file SamplingHandler.php.
Referenced by Monolog\Handler\SamplingHandler\__construct().
|
protected |
Definition at line 33 of file SamplingHandler.php.
Referenced by Monolog\Handler\SamplingHandler\__construct().