chg: [debug] added debugging to the logging for the potential uuid issue

uuid_debug
iglocska 2024-03-04 16:01:16 +01:00
parent 4b6c6240ef
commit fa3c2bcfab
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 14 additions and 0 deletions

View File

@ -146,6 +146,20 @@ class Log extends AppModel
}
}
$this->logData($this->data);
$matches = null;
$regex = '/uuid.\([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\).=>/';
if (preg_match($regex, $this->data['Log']['change'])) {
$controller = Configure::check('CurrentController') ? Configure::read('CurrentController') : 'SYSTEM';
$action = Configure::check('CurrentAction') ? Configure::read('CurrentAction') : 'SYSTEM';
$payload = sprintf(
"%s\nController: %s\nAction: %s\n\nChange: %s\n\n",
date("Y-m-d H:i:s"),
$controller,
$action,
$this->data['Log']['change']
);
file_put_contents(APP . '/tmp/logs/uuid_debug_log.txt', $payload, FILE_APPEND);
}
if ($this->data['Log']['action'] === 'request' && !empty(Configure::read('MISP.log_paranoid_skip_db'))) {
return false;
}