diff options
Diffstat (limited to 'plugins/Monolog/Handler/WebNotificationHandler.php')
-rw-r--r-- | plugins/Monolog/Handler/WebNotificationHandler.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/Monolog/Handler/WebNotificationHandler.php b/plugins/Monolog/Handler/WebNotificationHandler.php index 0269282c9f..c365403590 100644 --- a/plugins/Monolog/Handler/WebNotificationHandler.php +++ b/plugins/Monolog/Handler/WebNotificationHandler.php @@ -20,6 +20,8 @@ use Zend_Session_Exception; */ class WebNotificationHandler extends AbstractProcessingHandler { + const MAX_NOTIFICATION_MESSAGE_LENGTH = 512; + public function isHandling(array $record) { if (!empty($record['context']['ignoreInScreenWriter'])) { @@ -46,7 +48,11 @@ class WebNotificationHandler extends AbstractProcessingHandler break; } - $message = $record['level_name'] . ': ' . htmlentities($record['message'], ENT_COMPAT | ENT_HTML401, 'UTF-8'); + $recordMessage = $record['message']; + $recordMessage = str_replace(PIWIK_INCLUDE_PATH, '', $recordMessage); + $recordMessage = substr($recordMessage, 0, self::MAX_NOTIFICATION_MESSAGE_LENGTH); + + $message = $record['level_name'] . ': ' . htmlentities($recordMessage, ENT_COMPAT | ENT_HTML401, 'UTF-8'); $message .= $this->getLiteDebuggingInfo(); $notification = new Notification($message); |