ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Sends notifications through the hipchat api to a hipchat room. More...
Public Member Functions | ||||
__construct ($token, $room, $name='Monolog', $notify=false, $level=Logger::CRITICAL, $bubble=true, $useSSL=true, $format='text', $host='api.hipchat.com', $version=self::API_V1) | ||||
handleBatch (array $records) | ||||
{Handles a set of records at once.
| ||||
Public Member Functions inherited from Monolog\Handler\SocketHandler | ||||
__construct ($connectionString, $level=Logger::DEBUG, $bubble=true) | ||||
close () | ||||
We will not close a PersistentSocket instance so it can be reused in other requests. More... | ||||
closeSocket () | ||||
Close socket, if open. More... | ||||
setPersistent ($persistent) | ||||
Set socket connection to nbe persistent. More... | ||||
setConnectionTimeout ($seconds) | ||||
Set connection timeout. More... | ||||
setTimeout ($seconds) | ||||
Set write timeout. More... | ||||
setWritingTimeout ($seconds) | ||||
Set writing timeout. More... | ||||
getConnectionString () | ||||
Get current connection string. More... | ||||
isPersistent () | ||||
Get persistent setting. More... | ||||
getConnectionTimeout () | ||||
Get current connection timeout setting. More... | ||||
getTimeout () | ||||
Get current in-transfer timeout. More... | ||||
getWritingTimeout () | ||||
Get current local writing timeout. More... | ||||
isConnected () | ||||
Check to see if the socket is currently available. More... | ||||
Public Member Functions inherited from Monolog\Handler\AbstractProcessingHandler | ||||
handle (array $record) | ||||
{Handles a record.All records may be passed to this method, and the handler should discard those that it does not want to handle.The return value of this function controls the bubbling process of the handler stack. Unless the bubbling is interrupted (by returning true), the Logger class will keep on calling further handlers in the stack with a given log record.
| ||||
Public Member Functions inherited from Monolog\Handler\AbstractHandler | ||||
__construct ($level=Logger::DEBUG, $bubble=true) | ||||
isHandling (array $record) | ||||
{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.
| ||||
handleBatch (array $records) | ||||
{Handles a set of records at once.
| ||||
close () | ||||
Closes the handler. More... | ||||
pushProcessor ($callback) | ||||
{Adds a processor in the stack.
| ||||
popProcessor () | ||||
{Removes the processor on top of the stack and returns it.
| ||||
setFormatter (FormatterInterface $formatter) | ||||
{Sets the formatter.
| ||||
getFormatter () | ||||
{Gets the formatter.
| ||||
setLevel ($level) | ||||
Sets minimum logging level at which this handler will be triggered. More... | ||||
getLevel () | ||||
Gets minimum logging level at which this handler will be triggered. More... | ||||
setBubble ($bubble) | ||||
Sets the bubbling behavior. More... | ||||
getBubble () | ||||
Gets the bubbling behavior. More... | ||||
__destruct () | ||||
Data Fields | |
const | API_V1 = 'v1' |
Use API version 1. More... | |
const | API_V2 = 'v2' |
Use API version v2. More... | |
const | MAXIMUM_NAME_LENGTH = 15 |
The maximum allowed length for the name used in the "from" field. More... | |
const | MAXIMUM_MESSAGE_LENGTH = 9500 |
The maximum allowed length for the message. More... | |
Protected Member Functions | |
generateDataStream ($record) | |
{} More... | |
getAlertColor ($level) | |
Assigns a color to each level of log records. More... | |
write (array $record) | |
{} More... | |
Protected Member Functions inherited from Monolog\Handler\SocketHandler | |
write (array $record) | |
Connect (if necessary) and write to the socket. More... | |
pfsockopen () | |
Wrapper to allow mocking. More... | |
fsockopen () | |
Wrapper to allow mocking. More... | |
streamSetTimeout () | |
Wrapper to allow mocking. More... | |
fwrite ($data) | |
Wrapper to allow mocking. More... | |
streamGetMetadata () | |
Wrapper to allow mocking. More... | |
generateDataStream ($record) | |
getResource () | |
Protected Member Functions inherited from Monolog\Handler\AbstractProcessingHandler | |
write (array $record) | |
Writes the record down to the log of the implementing handler. More... | |
processRecord (array $record) | |
Processes a record. More... | |
Protected Member Functions inherited from Monolog\Handler\AbstractHandler | |
getDefaultFormatter () | |
Gets the default formatter. More... | |
Private Member Functions | |
buildContent ($record) | |
Builds the body of API call. More... | |
buildHeader ($content) | |
Builds the header of the API Call. More... | |
combineRecords ($records) | |
Combines multiple records into one. More... | |
validateStringLength ($str, $length) | |
Validates the length of a string. More... | |
Private Attributes | |
$token | |
$room | |
$name | |
$notify | |
$format | |
$host | |
$version | |
Additional Inherited Members | |
Protected Attributes inherited from Monolog\Handler\AbstractHandler | |
$level = Logger::DEBUG | |
$bubble = true | |
$formatter | |
$processors = array() | |
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)
Definition at line 29 of file HipChatHandler.php.
Monolog\Handler\HipChatHandler::__construct | ( | $token, | |
$room, | |||
$name = 'Monolog' , |
|||
$notify = false , |
|||
$level = Logger::CRITICAL , |
|||
$bubble = true , |
|||
$useSSL = true , |
|||
$format = 'text' , |
|||
$host = 'api.hipchat.com' , |
|||
$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. |
bool | $notify | Trigger a notification in clients or not |
int | $level | The minimum logging level at which this handler will be triggered |
bool | $bubble | Whether the messages that are handled can bubble up the stack or not |
bool | $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) |
Definition at line 98 of file HipChatHandler.php.
References Monolog\Handler\AbstractHandler\$bubble, Monolog\Handler\SocketHandler\$connectionString, Monolog\Handler\HipChatHandler\$format, Monolog\Handler\HipChatHandler\$host, Monolog\Handler\AbstractHandler\$level, Monolog\Handler\HipChatHandler\$name, Monolog\Handler\HipChatHandler\$notify, Monolog\Handler\HipChatHandler\$room, Monolog\Handler\HipChatHandler\$token, Monolog\Handler\HipChatHandler\$version, format, and Monolog\Handler\HipChatHandler\validateStringLength().
|
private |
Builds the body of API call.
array | $record |
Definition at line 135 of file HipChatHandler.php.
References $dataArray, Monolog\Handler\HipChatHandler\$room, array, format, Monolog\Handler\HipChatHandler\getAlertColor(), string, and Monolog\Handler\HipChatHandler\validateStringLength().
Referenced by Monolog\Handler\HipChatHandler\generateDataStream().
|
private |
Builds the header of the API Call.
string | $content |
Definition at line 174 of file HipChatHandler.php.
References $header, and Monolog\Handler\HipChatHandler\$room.
Referenced by Monolog\Handler\HipChatHandler\generateDataStream().
|
private |
Combines multiple records into one.
Error level of the combined record will be the highest level from the given records. Datetime will be taken from the first record.
$records |
Definition at line 259 of file HipChatHandler.php.
References Monolog\Handler\AbstractHandler\$level, $messages, $records, array, Monolog\Handler\AbstractHandler\getFormatter(), PHP_EOL, Monolog\Handler\AbstractProcessingHandler\processRecord(), and Monolog\Handler\HipChatHandler\validateStringLength().
Referenced by Monolog\Handler\HipChatHandler\handleBatch().
|
protected |
{}
array | $record |
Definition at line 122 of file HipChatHandler.php.
References Monolog\Handler\HipChatHandler\buildContent(), and Monolog\Handler\HipChatHandler\buildHeader().
|
protected |
Assigns a color to each level of log records.
int | $level |
Definition at line 198 of file HipChatHandler.php.
References Monolog\Handler\AbstractHandler\$level, Monolog\Logger\DEBUG, Monolog\Logger\ERROR, Monolog\Logger\INFO, and Monolog\Logger\WARNING.
Referenced by Monolog\Handler\HipChatHandler\buildContent().
Monolog\Handler\HipChatHandler::handleBatch | ( | array | $records | ) |
{Handles a set of records at once.
array | $records | The records to handle (an array of record arrays) |
Implements Monolog\Handler\HandlerInterface.
Definition at line 228 of file HipChatHandler.php.
References Monolog\Handler\AbstractHandler\$bubble, Monolog\Handler\HipChatHandler\combineRecords(), Monolog\Handler\AbstractHandler\isHandling(), and Monolog\Handler\HipChatHandler\write().
|
private |
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 | |
int | $length |
Definition at line 342 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct(), Monolog\Handler\HipChatHandler\buildContent(), and Monolog\Handler\HipChatHandler\combineRecords().
|
protected |
{}
array | $record |
Definition at line 219 of file HipChatHandler.php.
References Monolog\Handler\SocketHandler\closeSocket().
Referenced by Monolog\Handler\HipChatHandler\handleBatch().
|
private |
Definition at line 74 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct().
|
private |
Definition at line 79 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct().
|
private |
Definition at line 64 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct().
|
private |
Definition at line 69 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct().
|
private |
Definition at line 59 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct(), Monolog\Handler\HipChatHandler\buildContent(), and Monolog\Handler\HipChatHandler\buildHeader().
|
private |
Definition at line 54 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct().
|
private |
Definition at line 84 of file HipChatHandler.php.
Referenced by Monolog\Handler\HipChatHandler\__construct().
const Monolog\Handler\HipChatHandler::API_V1 = 'v1' |
Use API version 1.
Definition at line 34 of file HipChatHandler.php.
const Monolog\Handler\HipChatHandler::API_V2 = 'v2' |
Use API version v2.
Definition at line 39 of file HipChatHandler.php.
const Monolog\Handler\HipChatHandler::MAXIMUM_MESSAGE_LENGTH = 9500 |
The maximum allowed length for the message.
Definition at line 49 of file HipChatHandler.php.
const Monolog\Handler\HipChatHandler::MAXIMUM_NAME_LENGTH = 15 |
The maximum allowed length for the name used in the "from" field.
Definition at line 44 of file HipChatHandler.php.