$level
$level :
Sends notifications through Slack Webhooks
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 $webhookUrl, string|null $channel = null, string|null $username = null, boolean $useAttachment = true, string|null $iconEmoji = null, boolean $useShortAttachment = false, boolean $includeContextAndExtra = false, integer $level = \Monolog\Logger::CRITICAL, boolean $bubble = true, array $excludeFields = array())
string | $webhookUrl | Slack Webhook URL |
string|null | $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) |
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 |
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 |
array | $excludeFields | Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] |
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.