API_V1
API_V1 = 'v1'
Use API version 1
Sends notifications through the hipchat api to a hipchat room
Notes: API token - HipChat API token Room - HipChat Room Id or name, where messages are sent Name - Name used to send the message (from) notify - Should the message trigger a notification in the clients version - The API version to use (HipChatHandler::API_V1 | HipChatHandler::API_V2)
$formatter : \Monolog\Formatter\FormatterInterface
__construct(string $token, string $room, string $name = 'Monolog', boolean $notify = false, integer $level = \Monolog\Logger::CRITICAL, boolean $bubble = true, boolean $useSSL = true, string $format = 'text', string $host = 'api.hipchat.com', string $version = self::API_V1)
string | $token | HipChat API Token |
string | $room | The room that should be alerted of the message (Id or Name) |
string | $name | Name used in the "from" field. |
boolean | $notify | Trigger a notification in clients or not |
integer | $level | The minimum logging level at which this handler will be triggered |
boolean | $bubble | Whether the messages that are handled can bubble up the stack or not |
boolean | $useSSL | Whether to connect via SSL. |
string | $format | The format of the messages (default to text, can be set to html if you have html in the messages) |
string | $host | The HipChat server hostname. |
string | $version | The HipChat API version (default HipChatHandler::API_V1) |
isConnected() : boolean
Check to see if the socket is currently available.
UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
isHandling(array $record) : Boolean
Checks whether the given record will be handled by this handler.
This is mostly done for performance reasons, to avoid calling processors for nothing.
Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.
array | $record | Partial log record containing only a level key |
setFormatter(\Monolog\Formatter\FormatterInterface $formatter) : self
Sets the formatter.
\Monolog\Formatter\FormatterInterface | $formatter |
getFormatter() : \Monolog\Formatter\FormatterInterface
Gets the formatter.
getDefaultFormatter() : \Monolog\Formatter\FormatterInterface
Gets the default formatter.
validateStringLength(string $str, integer $length) : boolean
Validates the length of a string.
If the mb_strlen()
function is available, it will use that, as HipChat
allows UTF-8 characters. Otherwise, it will fall back to strlen()
.
Note that this might cause false failures in the specific case of using
a valid name with less than 16 characters, but 16 or more bytes, on a
system where mb_strlen()
is unavailable.
string | $str | |
integer | $length |