/home/desid573/public_html/tollster/vendor/monolog/monolog/src/Monolog/Handler
NameSizeModeActions
Curl/-0755rm
FingersCrossed/-0755rm
Slack/-0755rm
SyslogUdp/-0755rm
AbstractHandler.php41270644editdlrm
AbstractProcessingHandler.php14980644editdlrm
AbstractSyslogHandler.php33820644editdlrm
AmqpHandler.php38660644editdlrm
BrowserConsoleHandler.php71620644editdlrm
BufferHandler.php34360644editdlrm
ChromePHPHandler.php56230644editdlrm
CouchDBHandler.php19530644editdlrm
CubeHandler.php46310644editdlrm
DeduplicationHandler.php54790644editdlrm
DoctrineCouchDBHandler.php10000644editdlrm
DynamoDbHandler.php24400644editdlrm
ElasticSearchHandler.php34170644editdlrm
ErrorLogHandler.php23800644editdlrm
FilterHandler.php44250644editdlrm
FingersCrossedHandler.php56370644editdlrm
FirePHPHandler.php54660644editdlrm
FleepHookHandler.php33630644editdlrm
FlowdockHandler.php33570644editdlrm
GelfHandler.php20680644editdlrm
GroupHandler.php24960644editdlrm
HandlerInterface.php25970644editdlrm
HandlerWrapper.php21560644editdlrm
HipChatHandler.php103470644editdlrm
IFTTTHandler.php21180644editdlrm
LogEntriesHandler.php16010644editdlrm
LogglyHandler.php26190644editdlrm
MailHandler.php16220644editdlrm
MandrillHandler.php21560644editdlrm
MissingExtensionException.php4500644editdlrm
MongoDBHandler.php16060644editdlrm
NativeMailerHandler.php52060644editdlrm
NewRelicHandler.php60150644editdlrm
NullHandler.php9530644editdlrm
PHPConsoleHandler.php99900644editdlrm
PsrHandler.php14330644editdlrm
PushoverHandler.php66290644editdlrm
RavenHandler.php71150644editdlrm
RedisHandler.php28890644editdlrm
RollbarHandler.php38120644editdlrm
RotatingFileHandler.php56870644editdlrm
SamplingHandler.php26740644editdlrm
SlackbotHandler.php20290644editdlrm
SlackHandler.php63810644editdlrm
SlackWebhookHandler.php37370644editdlrm
SocketHandler.php88840644editdlrm
StreamHandler.php52030644editdlrm
SwiftMailerHandler.php30950644editdlrm
SyslogHandler.php18480644editdlrm
SyslogUdpHandler.php25800644editdlrm
TestHandler.php46760644editdlrm
WhatFailureGroupHandler.php14850644editdlrm
ZendMonitorHandler.php22400644editdlrm
Edit: /home/desid573/public_html/tollster/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php (2674B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; /** * 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. * * @author Bryan Davis * @author Kunal Mehta */ class SamplingHandler extends AbstractHandler { /** * @var callable|HandlerInterface $handler */ protected $handler; /** * @var int $factor */ protected $factor; /** * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). * @param int $factor Sample factor */ public function __construct($handler, $factor) { parent::__construct(); $this->handler = $handler; $this->factor = $factor; if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); } } public function isHandling(array $record) { return $this->handler->isHandling($record); } public function handle(array $record) { if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { // The same logic as in FingersCrossedHandler if (!$this->handler instanceof HandlerInterface) { $this->handler = call_user_func($this->handler, $record, $this); if (!$this->handler instanceof HandlerInterface) { throw new \RuntimeException("The factory callable should return a HandlerInterface"); } } if ($this->processors) { foreach ($this->processors as $processor) { $record = call_user_func($processor, $record); } } $this->handler->handle($record); } return false === $this->bubble; } }