mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-23 22:42:38 +01:00
Add optional server name
This commit is contained in:
parent
5bee6fe56c
commit
4763e09f65
@ -71,14 +71,15 @@ class HipChatHandler extends SocketHandler
|
||||
* @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 $server The HipChat server name.
|
||||
*/
|
||||
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text')
|
||||
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $server = '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://api.hipchat.com:443' : 'api.hipchat.com:80';
|
||||
$connectionString = $useSSL ? 'ssl://'.$server.':443' : $server.':80';
|
||||
parent::__construct($connectionString, $level, $bubble);
|
||||
|
||||
$this->token = $token;
|
||||
|
Loading…
x
Reference in New Issue
Block a user