mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Merge pull request #647 from rap2hpoutre/patch-1
Use `text` and `title` fields for SlackHandler
This commit is contained in:
@@ -145,29 +145,20 @@ class SlackHandler extends SocketHandler
|
|||||||
if ($this->useAttachment) {
|
if ($this->useAttachment) {
|
||||||
$attachment = array(
|
$attachment = array(
|
||||||
'fallback' => $record['message'],
|
'fallback' => $record['message'],
|
||||||
'color' => $this->getAttachmentColor($record['level'])
|
'color' => $this->getAttachmentColor($record['level']),
|
||||||
|
'fields' => array()
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->useShortAttachment) {
|
if ($this->useShortAttachment) {
|
||||||
$attachment['fields'] = array(
|
$attachment['title'] = $record['level_name'];
|
||||||
array(
|
$attachment['text'] = $record['message'];
|
||||||
'title' => $record['level_name'],
|
|
||||||
'value' => $record['message'],
|
|
||||||
'short' => false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
$attachment['fields'] = array(
|
$attachment['title'] = 'Message';
|
||||||
array(
|
$attachment['text'] = $record['message'];
|
||||||
'title' => 'Message',
|
$attachment['fields'][] = array(
|
||||||
'value' => $record['message'],
|
'title' => 'Level',
|
||||||
'short' => false
|
'value' => $record['level_name'],
|
||||||
),
|
'short' => true
|
||||||
array(
|
|
||||||
'title' => 'Level',
|
|
||||||
'value' => $record['level_name'],
|
|
||||||
'short' => true
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user