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.
$formatter : \Monolog\Formatter\FormatterInterface
$handler : callable|\Monolog\Handler\HandlerInterface
__construct(callable|\Monolog\Handler\HandlerInterface $handler, integer $factor)
Handler or factory callable($record, $fingersCrossedHandler).
isHandling(array $record) : Boolean
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.
Partial log record containing only a level key
setFormatter(\Monolog\Formatter\FormatterInterface $formatter) : self
Sets the formatter.
getFormatter() : \Monolog\Formatter\FormatterInterface
Gets the formatter.
getDefaultFormatter() : \Monolog\Formatter\FormatterInterface
Gets the default formatter.