Prechádzať zdrojové kódy

Added ability to pass in host parameter for LogEntriesHandler, closes #1174, fixes #1173

Matt K 7 rokov pred
rodič
commit
dd144f7fa2
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/Monolog/Handler/LogEntriesHandler.php

+ 2 - 2
src/Monolog/Handler/LogEntriesHandler.php

@@ -31,13 +31,13 @@ class LogEntriesHandler extends SocketHandler
      *
      * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
      */
-    public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true)
+    public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true, $host = 'data.logentries.com')
     {
         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';
+        $endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
         parent::__construct($endpoint, $level, $bubble);
         $this->logToken = $token;
     }