Exemplo n.º 1
0
 /**
  * @param string  $token  Pushover api token
  * @param string  $user   Pushover user id the message will be sent to
  * @param string  $title  Title sent to 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
  */
 public function __construct($token, $user, $title = null, $level = Logger::CRITICAL, $bubble = true)
 {
     parent::__construct('api.pushover.net:80', $level, $bubble);
     $this->token = $token;
     $this->user = $user;
     $this->title = $title ?: gethostname();
 }
 /**
  * @param string  $token  Pushover api token
  * @param string  $user   Pushover user id the message will be sent to
  * @param string  $title  Title sent to 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.
  */
 public function __construct($token, $user, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true)
 {
     $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->user = $user;
     $this->title = $title ?: gethostname();
 }
 /**
  * @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 MissingExtensionException if OpenSSL is missing
  */
 public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler');
     }
     parent::__construct('ssl://api.flowdock.com:443', $level, $bubble);
     $this->apiToken = $apiToken;
 }
Exemplo n.º 4
0
 /**
  * Construct a new Fleep.io Handler.
  *
  * For instructions on how to create a new web hook in your conversations
  * see https://fleep.io/integrations/webhooks/
  *
  * @param  string $token Webhook token
  * @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 MissingExtensionException
  */
 public function __construct($token, $level = Logger::DEBUG, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler');
     }
     $this->token = $token;
     $connectionString = 'ssl://' . self::FLEEP_HOST . ':443';
     parent::__construct($connectionString, $level, $bubble);
 }
Exemplo n.º 5
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 MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
  */
 public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true)
 {
     if ($useSSL && !extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
     }
     $endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80';
     parent::__construct($endpoint, $level, $bubble);
     $this->logToken = $token;
 }
Exemplo n.º 6
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.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true)
 {
     $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;
 }
Exemplo n.º 7
0
 /**
  * @param  string                    $token                  Slack API token
  * @param  string                    $channel                Slack channel (encoded ID or name)
  * @param  string                    $username               Name of a bot
  * @param  bool                      $useAttachment          Whether the message should be added to Slack as attachment (plain text otherwise)
  * @param  string|null               $iconEmoji              The emoji name to use (or null)
  * @param  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
  * @param  bool                      $useShortAttachment     Whether the the context/extra messages added to Slack as attachments are in a short style
  * @param  bool                      $includeContextAndExtra Whether the attachment should include context and extra data
  * @throws MissingExtensionException If no OpenSSL PHP extension configured
  */
 public function __construct($token, $channel, $username = '******', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
     }
     parent::__construct('ssl://slack.com:443', $level, $bubble);
     $this->slackRecord = new SlackRecord($channel, $username, $useAttachment, $iconEmoji, $useShortAttachment, $includeContextAndExtra, $this->formatter);
     $this->token = $token;
 }
 /**
  * LogstashHandler constructor.
  *
  * @param RequestStack $requestStack
  * @param bool|int $connectionString
  * @param bool $level
  * @param $bubble
  */
 public function __construct(RequestStack $requestStack, $connectionString, $level, $bubble, $customAttributes = array())
 {
     parent::__construct($connectionString, $level, $bubble);
     if ($requestStack) {
         $this->setRequest($requestStack->getCurrentRequest());
     }
     if (0 < count($customAttributes)) {
         $this->setCustomAttributes($customAttributes);
     }
 }
 /**
  * @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
  */
 public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY)
 {
     $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 ?: gethostname();
     $this->highPriorityLevel = $highPriorityLevel;
     $this->emergencyLevel = $emergencyLevel;
 }
Exemplo n.º 10
0
 /**
  * @param string $token         Slack API token
  * @param string $channel       Slack channel (encoded ID or name)
  * @param string $username      Name of a bot
  * @param bool   $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
  * @param 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
  */
 public function __construct($token, $channel, $username = '******', $useAttachment = true, $level = Logger::CRITICAL, $bubble = true)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
     }
     parent::__construct('ssl://slack.com:443', $level, $bubble);
     $this->token = $token;
     $this->channel = $channel;
     $this->username = $username;
     $this->useAttachment = $useAttachment;
 }
Exemplo n.º 11
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 bool   $bubble Whether the messages that are handled can bubble up the stack or not
  * @param bool   $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)
  * @param string $host   The HipChat server hostname.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com')
 {
     $connectionString = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
     $this->format = $format;
     $this->host = $host;
 }
Exemplo n.º 12
0
 /**
  * @param string     $token    Log token supplied by Logmatic.
  * @param string     $hostname Host name supplied by Logmatic.
  * @param string     $appname  Application name supplied by Logmatic.
  * @param bool       $useSSL   Whether or not SSL encryption should be used.
  * @param int|string $level    The minimum logging level to trigger this handler.
  * @param bool       $bubble   Whether or not messages that are handled should bubble up the stack.
  *
  * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
  */
 public function __construct(string $token, string $hostname = '', string $appname = '', bool $useSSL = true, $level = Logger::DEBUG, bool $bubble = true)
 {
     if ($useSSL && !extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use SSL encrypted connection for LogmaticHandler');
     }
     $endpoint = $useSSL ? 'ssl://api.logmatic.io:10515' : 'api.logmatic.io:10514';
     $endpoint .= '/v1/';
     parent::__construct($endpoint, $level, $bubble);
     $this->logToken = $token;
     $this->hostname = $hostname;
     $this->appname = $appname;
 }
Exemplo n.º 13
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.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true)
 {
     if (!$this->validateName($name)) {
         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;
 }
Exemplo n.º 14
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)
  * @param string  $host   The HipChat server hostname.
  */
 public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com')
 {
     if (!$this->validateStringLength($name, static::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://' . $host . ':443' : $host . ':80';
     parent::__construct($connectionString, $level, $bubble);
     $this->token = $token;
     $this->name = $name;
     $this->notify = $notify;
     $this->room = $room;
     $this->format = $format;
 }
Exemplo n.º 15
0
 /**
  * @param string $authToken  Plivo API Auth Token
  * @param string $authId     Plivo API Auth ID
  * @param string $fromNumber The phone number that will be shown as the sender ID
  * @param string $toNumber   The phone number to which the message will be sent
  * @param 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
  * @param bool   $useSSL     Whether to connect via SSL.
  * @param string $host       The Plivo server hostname.
  * @param string $version    The Plivo API version (default PlivoHandler::API_V1)
  * @param string $limit      The character limit
  */
 public function __construct($authToken, $authId, $fromNumber, $toNumber, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $host = 'api.plivo.com', $version = null, $limit = 160)
 {
     if (empty($version)) {
         throw new Exception('API Version is empty');
     }
     $connectionString = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
     parent::__construct($connectionString, $level, $bubble);
     $this->authToken = $authToken;
     $this->authId = $authId;
     $this->fromNumber = $fromNumber;
     $this->toNumber = $toNumber;
     $this->host = $host;
     $this->version = $version;
     $this->limit = $limit;
 }
Exemplo n.º 16
0
 /**
  * @param string      $token         Slack API token
  * @param string      $channel       Slack channel (encoded ID or name)
  * @param string      $username      Name of a bot
  * @param bool        $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
  * @param string|null $iconEmoji     The emoji name to use (or null)
  * @param 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
  */
 public function __construct($token, $channel, $username = '******', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeExtra = false)
 {
     if (!extension_loaded('openssl')) {
         throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
     }
     parent::__construct('ssl://slack.com:443', $level, $bubble);
     $this->token = $token;
     $this->channel = $channel;
     $this->username = $username;
     $this->iconEmoji = trim($iconEmoji, ':');
     $this->useAttachment = $useAttachment;
     $this->useShortAttachment = $useShortAttachment;
     $this->includeExtra = $includeExtra;
     if ($this->includeExtra) {
         $this->lineFormatter = new LineFormatter();
     }
 }