Ejemplo n.º 1
0
 /**
  * @param string   $apiToken
  * @param bool|int $level    The minimum logging level at which this handler will be triggered
  * @param bool     $bubble   Whether the messages that are handled can bubble up the stack or not
  *
  * @throws ehough_epilog_handler_MissingExtensionException if OpenSSL is missing
  */
 public function __construct($apiToken, $level = ehough_epilog_Logger::DEBUG, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new ehough_epilog_handler_MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler');
     }
     parent::__construct('ssl://api.flowdock.com:443', $level, $bubble);
     $this->apiToken = $apiToken;
 }
Ejemplo n.º 2
0
 /**
  * @param string  $token  Log token supplied by LogEntries
  * @param boolean $useSSL Whether or not SSL encryption should be used.
  * @param int     $level  The minimum logging level to trigger this handler
  * @param boolean $bubble Whether or not messages that are handled should bubble up the stack.
  *
  * @throws ehough_epilog_handler_MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
  */
 public function __construct($token, $useSSL = true, $level = ehough_epilog_Logger::DEBUG, $bubble = true)
 {
     if ($useSSL && !extension_loaded('openssl')) {
         throw new ehough_epilog_handler_MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
     }
     $endpoint = $useSSL ? 'ssl://api.logentries.com:20000' : 'data.logentries.com:80';
     parent::__construct($endpoint, $level, $bubble);
     $this->logToken = $token;
 }
Ejemplo n.º 3
0
 /**
  * @param string       $token             Pushover api token
  * @param string|array $users             Pushover user id or array of ids the message will be sent to
  * @param string       $title             Title sent to the Pushover API
  * @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      $useSSL            Whether to connect via SSL. Required when pushing messages to users that are not
  *                                        the pushover.net app owner. OpenSSL is required for this option.
  * @param integer      $highPriorityLevel The minimum logging level at which this handler will start
  *                                        sending "high priority" requests to the Pushover API
  * @param integer      $emergencyLevel    The minimum logging level at which this handler will start
  *                                        sending "emergency" requests to the Pushover API
  * @param integer      $retry             The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
  * @param integer      $expire            The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
  */
 public function __construct($token, $users, $title = null, $level = ehough_epilog_Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = ehough_epilog_Logger::CRITICAL, $emergencyLevel = ehough_epilog_Logger::EMERGENCY, $retry = 30, $expire = 25200)
 {
     $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->users = (array) $users;
     $this->title = $title ? $title : gethostname();
     $this->highPriorityLevel = $highPriorityLevel;
     $this->emergencyLevel = $emergencyLevel;
     $this->retry = $retry;
     $this->expire = $expire;
 }
Ejemplo n.º 4
0
 /**
  * @param string  $token  HipChat API Token
  * @param string  $room   The room that should be alerted of the message (Id or Name)
  * @param string  $name   Name used in the "from" field
  * @param bool    $notify Trigger a notification in clients or not
  * @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 Boolean $useSSL Whether to connect via SSL.
  * @param string  $format The format of the messages (default to text, can be set to html if you have html in the messages)
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = ehough_epilog_Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text')
 {
     if (!$this->validateStringLength($name, self::MAXIMUM_NAME_LENGTH)) {
         throw new InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
     }
     $connectionString = $useSSL ? 'ssl://api.hipchat.com:443' : 'api.hipchat.com:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
     $this->format = $format;
 }