mirror of https://github.com/MISP/MISP
chg: [syslog] output slightly changed
- always have a consistent number of fields conveyed, include delimited ( -- ) fields even if no data is passed to a field - Avoid linebreaks in contentpull/9693/head
parent
a55a19cd09
commit
be9ad95905
|
@ -431,15 +431,14 @@ class Log extends AppModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry = $data['Log']['action'];
|
$entry = sprintf(
|
||||||
if (!empty($data['Log']['title'])) {
|
'%s -- %s -- %s',
|
||||||
$entry .= " -- {$data['Log']['title']}";
|
$data['Log']['action'],
|
||||||
}
|
empty($data['Log']['title']) ? '' : $formatted_title = preg_replace('/\s+/', " ", $data['Log']['title']),
|
||||||
if (!empty($data['Log']['description'])) {
|
empty($data['Log']['description']) ?
|
||||||
$entry .= " -- {$data['Log']['description']}";
|
(empty($data['Log']['change']) ? '' : preg_replace('/\s+/', " ", $data['Log']['change'])) :
|
||||||
} else if (!empty($data['Log']['change'])) {
|
preg_replace('/\s+/', " ", $data['Log']['description'])
|
||||||
$entry .= " -- " . JsonTool::encode($data['Log']['change']);
|
);
|
||||||
}
|
|
||||||
$this->syslog->write($action, $entry);
|
$this->syslog->write($action, $entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue