Author: Jordi Boggiano (j.boggiano@seld.be)
Inheritance: implements Monolog\Handler\HandlerInterface
 /**
  * @param string $type
  * @param string $logFile
  * @param int $logLevel
  * @param array $logstash
  */
 public function __construct($type, $logFile, $logLevel, $logstash)
 {
     if ($type == self::LOGTYPE_STREAM) {
         $this->handler = new StreamHandler($logFile, $logLevel);
     } elseif ($type == self::LOGTYPE_LOGSTASH) {
         $this->handler = new StreamHandler($logFile, $logLevel);
         $this->handler->setFormatter(new LogstashFormatter($logstash['application_name']));
     }
 }
 /**
  * MemcachedBufferHandler constructor.
  *
  * @param HandlerInterface $handler
  * @param \Memcached       $memcachedDriver You may pass your own cache driver if it implements add(), get(), set()
  * @param int              $interval        How often messages will be thrown. In seconds
  * @param int              $level
  * @param bool|true        $bubble
  */
 public function __construct(HandlerInterface $handler, $memcachedDriver, $interval, $level = Logger::DEBUG, $bubble = true)
 {
     $this->handler = $handler;
     $this->memcached = $memcachedDriver;
     $this->interval = $interval;
     parent::__construct($level, $bubble);
 }
Ejemplo n.º 3
0
 /**
  * Create slack webhook handler
  *
  * @param string $url
  * @param string $channel
  * @param string $botname
  * @param int $level
  */
 public function __construct($url, $channel, $botname, $level = Logger::DEBUG)
 {
     parent::__construct($level);
     $this->url = $url;
     $this->channel = $channel;
     $this->botname = $botname;
 }
Ejemplo n.º 4
0
 /**
  * @param HandlerInterface $handler Handler.
  * @param integer $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
  * @param integer $level The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct(HandlerInterface $handler, $bufferSize = 0, $level = Logger::DEBUG, $bubble = false)
 {
     parent::__construct($level, $bubble);
     $this->handler = $handler;
     $this->bufferSize = $bufferSize;
     $this->bubble = $bubble;
 }
Ejemplo n.º 5
0
 public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
 {
     parent::__construct($level, $bubble);
     if (false === strpos(PHP_OS, 'WIN')) {
         $this->facilities['local0'] = LOG_LOCAL0;
         $this->facilities['local1'] = LOG_LOCAL1;
         $this->facilities['local2'] = LOG_LOCAL2;
         $this->facilities['local3'] = LOG_LOCAL3;
         $this->facilities['local4'] = LOG_LOCAL4;
         $this->facilities['local5'] = LOG_LOCAL5;
         $this->facilities['local6'] = LOG_LOCAL6;
         $this->facilities['local7'] = LOG_LOCAL7;
     }
     // convert textual description of facility to syslog constant
     if (array_key_exists(strtolower($facility), $this->facilities)) {
         $facility = $this->facilities[strtolower($facility)];
     } else {
         if (!in_array($facility, array_values($this->facilities), true)) {
             throw new \UnexpectedValueException('Unknown facility value "' . $facility . '" given');
         }
     }
     if (!openlog($ident, LOG_PID, $facility)) {
         throw new \LogicException('Can\'t open syslog for ident "' . $ident . '" and facility "' . $facility . '"');
     }
 }
 /**
  * @param HandlerInterface $handler         Handler.
  * @param integer          $bufferLimit     How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
  * @param integer          $level           The minimum logging level at which this handler will be triggered
  * @param Boolean          $bubble          Whether the messages that are handled can bubble up the stack or not
  * @param Boolean          $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
  */
 public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false)
 {
     parent::__construct($level, $bubble);
     $this->handler = $handler;
     $this->bufferLimit = (int) $bufferLimit;
     $this->flushOnOverflow = $flushOnOverflow;
 }
Ejemplo n.º 7
0
 /**
  * @param HandlerInterface $handler Handler.
  * @param integer $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
  * @param int $level The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  * @param int $reqLevel The level of message required to flush
  */
 public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $reqLevel = Logger::CRITICAL)
 {
     parent::__construct($level, $bubble);
     $this->handler = $handler;
     $this->bufferLimit = (int) $bufferLimit;
     $this->reqLevel = $reqLevel;
 }
 public function __construct($level, $token, $chatId, $async = false)
 {
     $this->token = $token;
     $this->chatId = $chatId;
     $this->async = $async;
     parent::__construct($level, false);
 }
 /**
  * @param File $file
  * @param Config $config
  * @param \Magento\Framework\Filesystem $filesystem
  */
 public function __construct(File $file, Config $config, \Magento\Framework\Filesystem $filesystem)
 {
     $this->file = $file;
     $this->config = $config;
     $this->filesystem = $filesystem;
     parent::__construct();
 }
Ejemplo n.º 10
0
 /**
  * @param HandlerInterface $handler    Handler.
  * @param integer          $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
  * @param integer          $level      The minimum logging level at which this handler will be triggered
  * @param Boolean          $bubble     Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct(HandlerInterface $handler, $bufferSize = 0, $level = Logger::DEBUG, $bubble = true)
 {
     parent::__construct($level, $bubble);
     $this->handler = $handler;
     $this->bufferSize = $bufferSize;
     // __destructor() doesn't get called on Fatal errors
     register_shutdown_function(array($this, 'close'));
 }
Ejemplo n.º 11
0
 /**
  * @param string $stream
  * @param integer $level The minimum logging level at which this handler will be triggered
  * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct($stream, $level = Logger::DEBUG, $bubble = true)
 {
     parent::__construct($level, $bubble);
     if (is_resource($stream)) {
         $this->stream = $stream;
     } else {
         $this->url = $stream;
     }
 }
Ejemplo n.º 12
0
 /**
  * @param HandlerInterface $handler         Handler.
  * @param integer          $bufferLimit     How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
  * @param integer          $level           The minimum logging level at which this handler will be triggered
  * @param Boolean          $bubble          Whether the messages that are handled can bubble up the stack or not
  * @param Boolean          $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
  */
 public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false)
 {
     parent::__construct($level, $bubble);
     $this->handler = $handler;
     $this->bufferLimit = (int) $bufferLimit;
     $this->flushOnOverflow = $flushOnOverflow;
     // __destructor() doesn't get called on Fatal errors
     register_shutdown_function(array($this, 'close'));
 }
Ejemplo n.º 13
0
 /**
  * @param LogFactory $logFactory
  * @param Config $avaTaxConfig
  */
 public function __construct(LogFactory $logFactory, Config $avaTaxConfig)
 {
     $this->logFactory = $logFactory;
     $this->avaTaxConfig = $avaTaxConfig;
     parent::__construct(Logger::DEBUG, true);
     $this->setFormatter(new LineFormatter(null, null, true));
     $introspectionProcessor = new IntrospectionProcessor();
     $webProcessor = new WebProcessor();
     $this->addExtraProcessors([$introspectionProcessor, $webProcessor]);
 }
Ejemplo n.º 14
0
 /**
  * @param int $level The minimum logging level at which this handler will be triggered
  */
 public function __construct($level = Logger::DEBUG)
 {
     parent::__construct($level, false);
 }
Ejemplo n.º 15
0
 /**
  * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied
  * @param int             $level  The minimum logging level at which this handler will be triggered
  * @param Boolean         $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true)
 {
     parent::__construct($level, $bubble);
     $this->logger = $logger;
 }
Ejemplo n.º 16
0
 public function __construct(AbstractHandler $handler, \Bubble\CatchBubble $catchBubble)
 {
     parent::__construct($handler->getLevel(), $handler->getBubble());
     $this->handler = $handler;
     $this->catchBubble = $catchBubble;
 }
Ejemplo n.º 17
0
 public function __construct($appName, StorageApiService $storageApiService)
 {
     $this->appName = $appName;
     $this->storageApiService = $storageApiService;
     parent::__construct();
 }
 /**
  * SlackWebhookHandler constructor.
  * @param int $webHookUrl
  * @param bool $level
  * @param $bubble
  */
 public function __construct($webHookUrl, $level, $bubble = true)
 {
     parent::__construct($level, $bubble);
     $this->webhookUrl = $webHookUrl;
 }
Ejemplo n.º 19
0
 public function __construct($url)
 {
     parent::__construct();
     $this->client = new Client();
     $this->url = $url;
 }