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:
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user