From 274f778b2429073231a39e3a1126c3f24d93707a Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Tue, 6 Sep 2016 23:48:20 +0300 Subject: [PATCH] Make channel in SlackRecord optional to allow for webhooks --- src/Monolog/Handler/Slack/SlackRecord.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Monolog/Handler/Slack/SlackRecord.php b/src/Monolog/Handler/Slack/SlackRecord.php index 3c64ef4b..95318849 100644 --- a/src/Monolog/Handler/Slack/SlackRecord.php +++ b/src/Monolog/Handler/Slack/SlackRecord.php @@ -96,12 +96,15 @@ class SlackRecord public function getSlackData(array $record) { $dataArray = array( - 'channel' => $this->channel, 'username' => $this->username, 'text' => '', 'attachments' => array(), ); + if ($this->channel) { + $dataArray['channel'] = $this->channel; + } + if ($this->formatter) { $message = $this->formatter->format($record); } else {