ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Sends notifications through Slack API. More...
Public Member Functions | ||||
__construct ($token, $channel, $username='Monolog', $useAttachment=true, $iconEmoji=null, $level=Logger::CRITICAL, $bubble=true, $useShortAttachment=false, $includeContextAndExtra=false) | ||||
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 () | ||||
Protected Member Functions | |
generateDataStream ($record) | |
{} More... | |
prepareContentData ($record) | |
Prepares content data. More... | |
write (array $record) | |
{} More... | |
getAttachmentColor ($level) | |
Returned a Slack message attachment color associated with provided level. More... | |
stringify ($fields) | |
Stringifies an array of key/value pairs to be used in attachment fields. 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... | |
Private Attributes | |
$token | |
$channel | |
$username | |
$iconEmoji | |
$useAttachment | |
$useShortAttachment | |
$includeContextAndExtra | |
$lineFormatter | |
Additional Inherited Members | |
Protected Attributes inherited from Monolog\Handler\AbstractHandler | |
$level = Logger::DEBUG | |
$bubble = true | |
$formatter | |
$processors = array() | |
Sends notifications through Slack API.
Definition at line 23 of file SlackHandler.php.
Monolog\Handler\SlackHandler::__construct | ( | $token, | |
$channel, | |||
$username = 'Monolog' , |
|||
$useAttachment = true , |
|||
$iconEmoji = null , |
|||
$level = Logger::CRITICAL , |
|||
$bubble = true , |
|||
$useShortAttachment = false , |
|||
$includeContextAndExtra = false |
|||
) |
string | $token | Slack API token |
string | $channel | Slack channel (encoded ID or name) |
string | $username | Name of a bot |
bool | $useAttachment | Whether the message should be added to Slack as attachment (plain text otherwise) |
string | null | $iconEmoji | The emoji name to use (or null) |
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 | $useShortAttachment | Whether the the context/extra messages added to Slack as attachments are in a short style |
bool | $includeContextAndExtra | Whether the attachment should include context and extra data |
MissingExtensionException | If no OpenSSL PHP extension configured |
Definition at line 84 of file SlackHandler.php.
References Monolog\Handler\AbstractHandler\$bubble, Monolog\Handler\SlackHandler\$channel, Monolog\Handler\SlackHandler\$iconEmoji, Monolog\Handler\SlackHandler\$includeContextAndExtra, Monolog\Handler\AbstractHandler\$level, Monolog\Handler\SlackHandler\$token, Monolog\Handler\SlackHandler\$useAttachment, Monolog\Handler\SlackHandler\$username, and Monolog\Handler\SlackHandler\$useShortAttachment.
|
private |
Builds the body of API call.
array | $record |
Definition at line 124 of file SlackHandler.php.
References $dataArray, and Monolog\Handler\SlackHandler\prepareContentData().
Referenced by Monolog\Handler\SlackHandler\generateDataStream().
|
private |
Builds the header of the API Call.
string | $content |
Definition at line 231 of file SlackHandler.php.
References $header.
Referenced by Monolog\Handler\SlackHandler\generateDataStream().
|
protected |
{}
array | $record |
Definition at line 111 of file SlackHandler.php.
References Monolog\Handler\SlackHandler\buildContent(), and Monolog\Handler\SlackHandler\buildHeader().
|
protected |
Returned a Slack message attachment color associated with provided level.
int | $level |
Definition at line 264 of file SlackHandler.php.
References Monolog\Handler\AbstractHandler\$level, Monolog\Logger\ERROR, Monolog\Logger\INFO, and Monolog\Logger\WARNING.
Referenced by Monolog\Handler\SlackHandler\prepareContentData().
|
protected |
Prepares content data.
array | $record |
Definition at line 137 of file SlackHandler.php.
References $dataArray, $message, array, Monolog\Handler\SlackHandler\getAttachmentColor(), and Monolog\Handler\SlackHandler\stringify().
Referenced by Monolog\Handler\SlackHandler\buildContent().
|
protected |
Stringifies an array of key/value pairs to be used in attachment fields.
array | $fields |
Definition at line 284 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\prepareContentData().
|
protected |
{}
array | $record |
Definition at line 247 of file SlackHandler.php.
References $res, Monolog\Handler\SocketHandler\closeSocket(), and Monolog\Handler\SocketHandler\getResource().
|
private |
Definition at line 35 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().
|
private |
Definition at line 47 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().
|
private |
Definition at line 65 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().
|
private |
Definition at line 70 of file SlackHandler.php.
|
private |
Definition at line 29 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().
|
private |
Definition at line 53 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().
|
private |
Definition at line 41 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().
|
private |
Definition at line 59 of file SlackHandler.php.
Referenced by Monolog\Handler\SlackHandler\__construct().