From c6739b7659320784ee3b556a5eb0b1d4e971e40d Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 1 Apr 2020 23:53:08 +0200 Subject: [PATCH] chg: [syslog] added title of log entry --- app/Model/Log.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Model/Log.php b/app/Model/Log.php index 4df47f92e..e041fce97 100644 --- a/app/Model/Log.php +++ b/app/Model/Log.php @@ -323,7 +323,6 @@ class Log extends AppModel $elasticSearchClient = $this->getElasticSearchTool(); $elasticSearchClient->pushDocument($logIndex, "log", $data); } - if (Configure::read('Security.syslog')) { // write to syslogd as well $syslog = new SysLog(); @@ -338,8 +337,17 @@ class Log extends AppModel } $entry = $data['Log']['action']; + if (!empty($data['Log']['title'])) { + $entry .= sprintf( + ' -- %s', + $data['Log']['title'] + ); + } if (!empty($data['Log']['description'])) { - $entry .= sprintf(' -- %s', $data['Log']['description']); + $entry .= sprintf( + ' -- %s', + $data['Log']['description'] + ); } $syslog->write($action, $entry); }