1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 23:24:02 +02:00

Make channel in SlackRecord optional to allow for webhooks

This commit is contained in:
Haralan Dobrev
2016-09-06 23:48:20 +03:00
parent f584e56ae1
commit 274f778b24

View File

@@ -96,12 +96,15 @@ class SlackRecord
public function getSlackData(array $record) public function getSlackData(array $record)
{ {
$dataArray = array( $dataArray = array(
'channel' => $this->channel,
'username' => $this->username, 'username' => $this->username,
'text' => '', 'text' => '',
'attachments' => array(), 'attachments' => array(),
); );
if ($this->channel) {
$dataArray['channel'] = $this->channel;
}
if ($this->formatter) { if ($this->formatter) {
$message = $this->formatter->format($record); $message = $this->formatter->format($record);
} else { } else {