$level
$level :
Sends notifications through Slack API
Classes extending it should (in most cases) only implement write($record)
$formatter : \Monolog\Formatter\FormatterInterface
$slackRecord : \Monolog\Handler\Slack\SlackRecord
Instance of the SlackRecord util class preparing data for Slack API.
__construct(string $token, string $channel, string|null $username = null, boolean $useAttachment = true, string|null $iconEmoji = null, integer $level = \Monolog\Logger::CRITICAL, boolean $bubble = true, boolean $useShortAttachment = false, boolean $includeContextAndExtra = false, array $excludeFields = array())
string | $token | Slack API token |
string | $channel | Slack channel (encoded ID or name) |
string|null | $username | Name of a bot |
boolean | $useAttachment | Whether the message should be added to Slack as attachment (plain text otherwise) |
string|null | $iconEmoji | The emoji name to use (or null) |
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 | $useShortAttachment | Whether the the context/extra messages added to Slack as attachments are in a short style |
boolean | $includeContextAndExtra | Whether the attachment should include context and extra data |
array | $excludeFields | Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] |
If no OpenSSL PHP extension configured
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)
\Monolog\Formatter\FormatterInterface | $formatter |
getDefaultFormatter() : \Monolog\Formatter\FormatterInterface
Gets the default formatter.
stringify(array $fields) : string
Stringifies an array of key/value pairs to be used in attachment fields
array | $fields |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
buildContent(array $record) : string
Builds the body of API call
array | $record |
None found |
buildHeader(string $content) : string
Builds the header of the API Call
string | $content |
None found |