/**
  * @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 MissingExtensionExcpetion 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://api.logentries.com:20000' : 'data.logentries.com:80';
     parent::__construct($endpoint, $level, $bubble);
     $this->logToken = $token;
 }
示例#2
0
 /**
  * {@inheritdoc}
  *
  * @param array $record
  */
 protected function write(array $record)
 {
     parent::write($record);
     $this->closeSocket();
 }
示例#3
0
 protected function write(array $record)
 {
     foreach ($this->users as $user) {
         $this->user = $user;
         parent::write($record);
         $this->closeSocket();
     }
     $this->user = null;
 }