62 $includeContextAndExtra,
83 protected function write(array $record)
85 $postData = $this->slackRecord->getSlackData($record);
90 CURLOPT_URL => $this->webhookUrl,
92 CURLOPT_RETURNTRANSFER =>
true,
93 CURLOPT_HTTPHEADER => array(
'Content-type: application/json'),
94 CURLOPT_POSTFIELDS => $postString
96 if (defined(
'CURLOPT_SAFE_UPLOAD')) {
97 $options[CURLOPT_SAFE_UPLOAD] =
true;
107 parent::setFormatter($formatter);
108 $this->slackRecord->setFormatter($formatter);
Base Handler class providing the Handler structure.
Sends notifications through Slack Webhooks.
getFormatter()
Gets the formatter.
static execute($ch, $retries=5, $closeAfterDone=true)
Executes a CURL request with optional retries and exception on failure.
setFormatter(FormatterInterface $formatter)
Sets the formatter.
Slack record utility helping to log to Slack webhooks or API.
if($session===NULL) $postData
const CRITICAL
Critical conditions.
__construct($webhookUrl, $channel=null, $username=null, $useAttachment=true, $iconEmoji=null, $useShortAttachment=false, $includeContextAndExtra=false, $level=Logger::CRITICAL, $bubble=true, array $excludeFields=array())