|
@@ -144,19 +144,25 @@ class SlackHandler extends SocketHandler
|
|
|
'attachments' => array(),
|
|
'attachments' => array(),
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+ if ($this->formatter) {
|
|
|
|
|
+ $message = $this->formatter->format($record);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $message = $record['message'];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if ($this->useAttachment) {
|
|
if ($this->useAttachment) {
|
|
|
$attachment = array(
|
|
$attachment = array(
|
|
|
- 'fallback' => $record['message'],
|
|
|
|
|
|
|
+ 'fallback' => $message,
|
|
|
'color' => $this->getAttachmentColor($record['level']),
|
|
'color' => $this->getAttachmentColor($record['level']),
|
|
|
'fields' => array(),
|
|
'fields' => array(),
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if ($this->useShortAttachment) {
|
|
if ($this->useShortAttachment) {
|
|
|
$attachment['title'] = $record['level_name'];
|
|
$attachment['title'] = $record['level_name'];
|
|
|
- $attachment['text'] = $record['message'];
|
|
|
|
|
|
|
+ $attachment['text'] = $message;
|
|
|
} else {
|
|
} else {
|
|
|
$attachment['title'] = 'Message';
|
|
$attachment['title'] = 'Message';
|
|
|
- $attachment['text'] = $record['message'];
|
|
|
|
|
|
|
+ $attachment['text'] = $message;
|
|
|
$attachment['fields'][] = array(
|
|
$attachment['fields'][] = array(
|
|
|
'title' => 'Level',
|
|
'title' => 'Level',
|
|
|
'value' => $record['level_name'],
|
|
'value' => $record['level_name'],
|
|
@@ -206,7 +212,7 @@ class SlackHandler extends SocketHandler
|
|
|
|
|
|
|
|
$dataArray['attachments'] = json_encode(array($attachment));
|
|
$dataArray['attachments'] = json_encode(array($attachment));
|
|
|
} else {
|
|
} else {
|
|
|
- $dataArray['text'] = $record['message'];
|
|
|
|
|
|
|
+ $dataArray['text'] = $message;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ($this->iconEmoji) {
|
|
if ($this->iconEmoji) {
|