1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-19 15:49:19 +02:00

#493 Include context in slack extra info.

This commit is contained in:
Jamie Learmonth
2015-02-09 22:35:23 +00:00
parent 7583a2b96b
commit 01e593cdeb

View File

@@ -169,6 +169,15 @@ class SlackHandler extends SocketHandler
'value' => $extra,
'short' => false
);
// Add all context items as individual fields
foreach ($record['context'] as $var => $val) {
$attachment['fields'][] = array(
'title' => $var,
'value' => $val,
'short' => true
);
}
}
$dataArray['attachments'] = json_encode(array($attachment));